/* ═══════════════════════════════════════════════════════
   calculadora.css | Calculadora page styles
   Depends on: ../../css/main.css
   ═══════════════════════════════════════════════════════ */

/* ─── TYPOGRAPHY EXTENSIONS ─────────────────────────── */

.t-hero {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(32px, 4.2vw, 64px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--black);
}

.t-body-fig {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(13px, 1.1vw, 15px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.005em;
  color: var(--dark-grey);
}

/* ─── SUBPAGE HERO OVERRIDE ─────────────────────────── */
/* Kill the 60vh min-height and tighten padding so the
   hero is only as tall as the title needs to be */
.subpage-hero {
  min-height: unset;
  padding: 40px 0 40px;
}

/* ─── PAGE WRAPPER ───────────────────────────────────── */
.calc-page {
  border-top: 0.5px solid var(--divider);
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 5vw, 72px);
  align-items: flex-start;
  width: 100%;
  max-width: var(--max-w);
  padding: clamp(40px, 5.5vw, 72px) 0 clamp(80px, 10vw, 160px);
}

/* ─── RESPONSIVE ─────────────────────────────────────── */
/* (rules at bottom of file) */

/* ─── TWO-COLUMN BODY ────────────────────────────────── */
.calc-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
  width: 100%;
  margin-top: 0;
}

/* ─── INPUT COLUMN ───────────────────────────────────── */
.calc-input-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: clamp(20px, 3vw, 40px);
}

.input-card {
  border: 1px solid var(--divider);
  border-radius: 20px;
  padding: clamp(24px, 3vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #fff;
}

.input-card-label {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(10px, 0.9vw, 12px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-1);
}

.input-field-label {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(13px, 1.1vw, 15px);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--black);
  margin-bottom: 8px;
}

.input-field-label em {
  font-weight: 400;
  color: var(--dark-grey);
  font-style: normal;
}

.input-wrapper {
  position: relative;
}

.currency-prefix {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(16px, 1.5vw, 20px);
  color: var(--accent-1);
  pointer-events: none;
  font-weight: 500;
}

.main-input {
  width: 100%;
  border: 1.5px solid var(--divider);
  border-radius: 12px;
  padding: clamp(14px, 1.4vw, 18px) 16px clamp(14px, 1.4vw, 18px) 40px;
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(18px, 1.8vw, 24px);
  color: var(--black);
  letter-spacing: -0.02em;
  outline: none;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  -moz-appearance: textfield;
}
.main-input::-webkit-inner-spin-button,
.main-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.main-input:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(72, 92, 17, 0.1);
}

.input-hint {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--dark-grey);
  margin-top: 6px;
}

/* ─── PRESET PILLS ───────────────────────────────────── */
.preset-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--dark-grey);
  margin-bottom: 8px;
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-btn {
  background: var(--accent-2);
  border: none;
  border-radius: 1000px;
  padding: 7px 14px;
  font-family: 'Roboto Mono', monospace;
  font-size: 12px;
  color: var(--black);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-weight: 400;
}
.preset-btn:hover {
  background: #c8ddb0;
  transform: translateY(-1px);
}

/* ─── INFO NOTES ─────────────────────────────────────── */
.info-note {
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 16px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--dark-grey);
  line-height: 1.55;
  background: #fafafa;
}

.info-note strong {
  color: var(--accent-1);
  font-weight: 700;
}

.info-note--green {
  border-color: var(--accent-2);
  background: #eef3f9bc;
}

/* ─── RESULTS COLUMN ─────────────────────────────────── */
.calc-results-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── EMPTY STATE ────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 32px;
  border: 1px dashed var(--divider);
  border-radius: 20px;
  text-align: center;
}

.empty-icon {
  width: 48px;
  height: 48px;
  opacity: 0.2;
}

.empty-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--dark-grey);
  line-height: 1.5;
}

/* ─── SAVINGS HERO CARD ──────────────────────────────── */
.savings-hero-card {
  background: var(--accent-1);
  border-radius: 20px;
  padding: clamp(20px, 2.5vw, 32px) clamp(24px, 3vw, 36px);
  display: flex;
  align-items: center;
  gap: 20px;
  animation: fadeSlideIn 0.3s ease;
}

.savings-hero-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent-2);
}

.savings-hero-label {
  font-family: 'Roboto Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 6px;
}

.savings-hero-value {
  font-family: 'Source Sans 3', sans-serif;
  font-size: clamp(28px, 3.5vw, 48px);
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.04em;
  line-height: 1;
}

/* ─── RESULT GROUPS ──────────────────────────────────── */
.result-group {
  border: 1px solid var(--divider);
  border-radius: 20px;
  overflow: hidden;
  animation: fadeSlideIn 0.3s ease;
}

.result-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--divider);
  background: #fafafa;
}

.result-group-header .group-label {
  font-family: 'Roboto Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-1);
}

.result-group-header .group-icon {
  width: 18px;
  height: 18px;
  color: var(--accent-1);
  flex-shrink: 0;
}

/* ─── RESULT ROWS ────────────────────────────────────── */
.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--divider);
  gap: 16px;
  transition: background 0.15s;
}
.result-row:last-child { border-bottom: none; }
.result-row:hover { background: #fafafa; }

.result-row-label {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(12px, 1vw, 14px);
  color: var(--dark-grey);
  flex: 1;
  line-height: 1.35;
}

.result-row-value {
  font-family: 'Roboto Mono', monospace;
  font-size: clamp(13px, 1.1vw, 15px);
  color: var(--black);
  white-space: nowrap;
  text-align: right;
}

/* Total rows */
.result-row.is-total {
  background: #eef3f9bc;
}
.result-row.is-total .result-row-label {
  font-weight: 700;
  color: var(--black);
}
.result-row.is-total .result-row-value {
  color: var(--accent-1);
  font-weight: 500;
}

/* Value colour modifiers */
.val-savings { color: var(--accent-1) !important; }
.val-cost    { color: #b44 !important; }

/* ─── FOOTNOTES ──────────────────────────────────────── */
.calc-footnotes {
  border-top: 0.5px solid var(--divider);
  padding-top: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 32px;
  width: 100%;
}

.calc-footnotes p {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--dark-grey);
  line-height: 1.6;
}
.calc-footnotes a {
  color: var(--accent-1);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ─── PAYMENT INFO BUTTON ───────────────────────────── */
.btn-payment-info {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  background: var(--accent-1) !important;
  border: 1.5px solid var(--accent-1) !important;
  border-radius: 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff !important;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
  margin-top: 4px;
  box-sizing: border-box;
}
.btn-payment-info:hover {
  background: #2a5a82 !important;
  border-color: #2a5a82 !important;
  transform: translateY(-1px);
}
.btn-payment-info:active {
  transform: translateY(0);
}
.btn-payment-info svg {
  flex-shrink: 0;
  stroke: #fff;
}
.btn-payment-info .btn-arrow {
  margin-left: auto;
}

/* ─── DOWNLOAD BUTTON ───────────────────────────────── */
/* !important on background/border overrides the global:
   button { background: none; border: none; } reset in main.css */
.btn-download {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  background: #fff !important;
  border: 1.5px solid var(--divider) !important;
  border-radius: 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-1) !important;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
  margin-top: 4px;
  box-sizing: border-box;
}
.btn-download:hover {
  background: #cbe4f8 !important;
  border-color: var(--accent-1) !important;
  transform: translateY(-1px);
}
.btn-download:active {
  transform: translateY(0);
}
.btn-download svg {
  flex-shrink: 0;
  stroke: var(--accent-1);
}

/* ─── ANIMATION ──────────────────────────────────────── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .calc-body {
    grid-template-columns: 1fr;
  }

  .calc-input-col {
    position: static;
  }

  .calc-footnotes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .savings-hero-value {
    font-size: clamp(24px, 7vw, 36px);
  }
}

/* ─── PAYMENT CONFIRMATION MODAL ────────────────────── */
#payment-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  /* Blur + dim the page behind */
  backdrop-filter: blur(8px) brightness(0.55);
  -webkit-backdrop-filter: blur(8px) brightness(0.55);
  background: rgba(0, 0, 0, 0.35);
  /* Hidden by default */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

#payment-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.payment-modal {
  background: #fff;
  border-radius: 24px;
  padding: clamp(32px, 4vw, 52px) clamp(28px, 4vw, 48px);
  max-width: 520px;
  width: 100%;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.14),
    0 32px 80px rgba(0, 0, 0, 0.18);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.34, 1.36, 0.64, 1);
}

#payment-modal-overlay.active .payment-modal {
  transform: translateY(0) scale(1);
}

.payment-modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--accent-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.payment-modal-icon svg {
  stroke: var(--accent-1);
}

.payment-modal-eyebrow {
  font-family: 'Roboto Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-1);
  margin-bottom: 8px;
}

.payment-modal-title {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--black);
  margin-bottom: 20px;
  line-height: 1.15;
}

.payment-modal-body {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.7;
  color: var(--dark-grey);
  margin-bottom: 14px;
}

.payment-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  margin-bottom: 20px;
}

.payment-modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  padding: 14px 20px;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s, transform 0.1s;
  border: none !important;
}

.payment-modal-btn--no {
  background: #f0f0f0 !important;
  color: var(--dark-grey) !important;
}
.payment-modal-btn--no:hover {
  background: #e4e4e4 !important;
  transform: translateY(-1px);
}
.payment-modal-btn--no svg {
  stroke: var(--dark-grey);
}

.payment-modal-btn--yes {
  background: var(--accent-1) !important;
  color: #fff !important;
}
.payment-modal-btn--yes:hover {
  background: #2a5a82 !important;
  transform: translateY(-1px);
}
.payment-modal-btn--yes svg {
  stroke: #fff;
}

.payment-modal-contact {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--dark-grey);
  text-align: center;
  line-height: 1.6;
}

.payment-modal-contact a {
  color: var(--accent-1);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 480px) {
  .payment-modal-actions {
    flex-direction: column;
  }
}
