/* ============================================================
   calculator.css - scoped under .calc namespace
   Only styles for the life insurance calculator page.
   Does NOT redefine global styles from style.css.
   ============================================================ */

/* ── Reset helpers (scoped) ── */
.calc-page-wrap button,
.calc-page-wrap input,
.calc-page-wrap label,
.calc-page-wrap select {
  font-family: inherit;
}

/* ── Page structure ── */
.calc-page-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #F7F9FC;
}

.calc-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 80px;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

/* ── Hero strip ── */
.calc-hero {
  width: 100%;
  max-width: 640px;
  padding: 48px 0 32px;
  text-align: center;
}

.calc-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2E7D32;
  margin-bottom: 12px;
}

.calc-h1 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 800;
  color: #1F4E79;
  line-height: 1.2;
  margin-bottom: 12px;
}

.calc-subhead {
  font-size: 1rem;
  color: #6B7280;
  line-height: 1.5;
}

/* ── Main calculator card wrap ── */
.calc-card-wrap {
  width: 100%;
  max-width: 560px;
  background: #fff;
  border: 1px solid #DBE3EA;
  border-radius: 16px;
  padding: 28px 24px 32px;
  box-shadow: 0 2px 16px rgba(31, 78, 121, 0.07);
}

/* ── Progress bar ── */
.calc-progress-bar {
  height: 6px;
  background: #DBE3EA;
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 10px;
}

.calc-progress-fill {
  height: 100%;
  background: #2E7D32;
  border-radius: 99px;
  transition: width 0.3s ease;
  width: 20%;
}

.calc-progress-label {
  font-size: 0.78rem;
  color: #6B7280;
  margin-bottom: 28px;
  min-height: 1.2em;
}

.calc-time-hint {
  color: #2E7D32;
  font-weight: 600;
}

/* ── Step visibility + transitions ── */
.calc-step {
  animation: calcFadeIn 0.2s ease;
}

.calc-step--hidden {
  display: none;
}

@keyframes calcFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Questions ── */
.calc-question {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1F2937;
  margin-bottom: 8px;
  line-height: 1.4;
}

.calc-hint {
  font-size: 0.85rem;
  color: #6B7280;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ── Text inputs with $ prefix ── */
.calc-input-group {
  display: flex;
  align-items: center;
  border: 2px solid #DBE3EA;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.15s;
  margin-bottom: 12px;
}

.calc-input-group:focus-within {
  border-color: #1F4E79;
}

.calc-input-group--narrow {
  max-width: 160px;
}

.calc-input-prefix {
  padding: 0 14px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #6B7280;
  background: #F7F9FC;
  border-right: 2px solid #DBE3EA;
  height: 52px;
  display: flex;
  align-items: center;
  user-select: none;
}

.calc-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 16px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1F2937;
  background: transparent;
  height: 52px;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
}

.calc-input::placeholder {
  color: #9CA3AF;
  font-weight: 400;
}

/* Age input (no prefix) */
.calc-input-group--narrow .calc-input {
  padding-left: 18px;
  width: 100%;
  text-align: left;
}

/* ── Radio cards ── */
.calc-radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.calc-radio-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid #DBE3EA;
  border-radius: 10px;
  padding: 14px 18px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-height: 52px;
  font-weight: 500;
  color: #1F2937;
  font-size: 0.95rem;
  user-select: none;
}

.calc-radio-card:hover {
  border-color: #1F4E79;
  background: #F7F9FC;
}

.calc-radio-card input[type="radio"] {
  accent-color: #1F4E79;
  width: 20px;
  height: 20px;
  min-width: 20px;
  cursor: pointer;
}

.calc-radio-card.selected,
.calc-radio-card:has(input:checked) {
  border-color: #1F4E79;
  background: #EEF4FB;
  color: #1F4E79;
}

/* ── Checkbox rows ── */
.calc-checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #6B7280;
  user-select: none;
}

.calc-checkbox-row input[type="checkbox"] {
  accent-color: #1F4E79;
  width: 18px;
  height: 18px;
  min-width: 18px;
  cursor: pointer;
}

/* ── Nav row (Next / Back) ── */
.calc-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  gap: 12px;
}

.calc-btn-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1F4E79;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 52px;
  min-width: 140px;
  transition: background 0.15s, transform 0.1s;
  justify-content: center;
}

.calc-btn-next:hover {
  background: #163d62;
}

.calc-btn-next:active {
  transform: scale(0.97);
}

.calc-btn-calc {
  background: #2E7D32;
}

.calc-btn-calc:hover {
  background: #235c26;
}

.calc-btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: #6B7280;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 12px 4px;
  min-height: 44px;
  transition: color 0.15s;
}

.calc-btn-back:hover {
  color: #1F2937;
}

/* ── Validation errors on inputs ── */
.calc-input.calc-error,
.calc-input-group.calc-error {
  border-color: #DC2626;
}

.calc-field-error {
  font-size: 0.8rem;
  color: #DC2626;
  margin-top: 4px;
  margin-bottom: 8px;
}

/* ── Result step ── */
.calc-result {
  text-align: center;
}

.calc-result-label {
  font-size: 1rem;
  color: #6B7280;
  margin-bottom: 8px;
}

.calc-result-number {
  font-size: clamp(2.5rem, 12vw, 5rem);
  font-weight: 800;
  color: #1F4E79;
  line-height: 1;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.calc-result-sub {
  font-size: 0.85rem;
  color: #6B7280;
  margin-bottom: 28px;
}

/* ── Breakdown card ── */
.calc-breakdown {
  text-align: left;
  background: #F7F9FC;
  border: 1px solid #DBE3EA;
  border-radius: 12px;
  padding: 20px 20px 16px;
  margin-bottom: 20px;
}

.calc-breakdown-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6B7280;
  margin-bottom: 14px;
}

.calc-breakdown-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calc-breakdown-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 0.9rem;
  color: #1F2937;
  line-height: 1.4;
}

.calc-breakdown-list li .bd-label {
  flex: 1;
  color: #1F2937;
}

.calc-breakdown-list li .bd-value {
  font-weight: 700;
  color: #1F4E79;
  white-space: nowrap;
}

/* ── Disclaimer ── */
.calc-disclaimer {
  font-size: 0.82rem;
  color: #6B7280;
  line-height: 1.6;
  border-left: 3px solid #2E7D32;
  padding: 10px 14px;
  background: #f0faf1;
  border-radius: 0 8px 8px 0;
  text-align: left;
  margin-bottom: 28px;
}

/* ── Email gate card ── */
.calc-email-gate {
  background: #fff;
  border: 2px solid #DBE3EA;
  border-radius: 14px;
  padding: 24px 20px 20px;
  margin-bottom: 20px;
  text-align: left;
}

.calc-gate-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1F2937;
  margin-bottom: 6px;
}

.calc-gate-sub {
  font-size: 0.85rem;
  color: #6B7280;
  margin-bottom: 20px;
}

.calc-form-row {
  margin-bottom: 14px;
}

.calc-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.calc-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1F2937;
}

.calc-form-input {
  border: 2px solid #DBE3EA;
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 1rem;
  color: #1F2937;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
  min-height: 48px;
  font-family: inherit;
}

.calc-form-input:focus {
  border-color: #1F4E79;
}

.calc-form-input.calc-error {
  border-color: #DC2626;
}

.calc-form-error {
  font-size: 0.82rem;
  color: #DC2626;
  margin-bottom: 10px;
  min-height: 1.2em;
}

/* Honeypot: visually hidden, NOT display:none */
.calc-honeypot {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
}

.calc-btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: #2E7D32;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 16px 24px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 52px;
  transition: background 0.15s, transform 0.1s;
}

.calc-btn-submit:hover {
  background: #235c26;
}

.calc-btn-submit:active {
  transform: scale(0.97);
}

.calc-btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.calc-spinner {
  font-size: 1rem;
}

/* ── Post-submit success card ── */
.calc-success-card {
  text-align: center;
  background: #f0faf1;
  border: 2px solid #2E7D32;
  border-radius: 14px;
  padding: 28px 20px;
  margin-bottom: 20px;
}

.calc-success-icon {
  font-size: 2.2rem;
  color: #2E7D32;
  margin-bottom: 10px;
}

.calc-success-msg {
  font-size: 0.95rem;
  color: #1F2937;
  font-weight: 600;
  margin-bottom: 18px;
}

.calc-btn-book {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1F4E79;
  color: #fff;
  border-radius: 10px;
  padding: 14px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  min-height: 52px;
  transition: background 0.15s;
}

.calc-btn-book:hover {
  background: #163d62;
}

/* ── Share row ── */
.calc-share-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 16px;
}

.calc-btn-share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #1F4E79;
  border: 2px solid #1F4E79;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.15s, color 0.15s;
}

.calc-btn-share:hover {
  background: #1F4E79;
  color: #fff;
}

.calc-toast {
  font-size: 0.82rem;
  color: #2E7D32;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.calc-toast.visible {
  opacity: 1;
}

/* ── Always-visible book call link ── */
.calc-book-row {
  text-align: center;
  margin-top: 4px;
  margin-bottom: 8px;
  padding-bottom: env(safe-area-inset-bottom);
}

.calc-link-book {
  font-size: 0.88rem;
  color: #1F4E79;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
}

.calc-link-book:hover {
  text-decoration: underline;
}

/* ── FAQ section ── */
.calc-faq {
  width: 100%;
  max-width: 560px;
  margin-top: 48px;
}

.calc-faq-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1F4E79;
  margin-bottom: 20px;
}

.calc-faq-item {
  border-top: 1px solid #DBE3EA;
}

.calc-faq-item:last-child {
  border-bottom: 1px solid #DBE3EA;
}

.calc-faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 0;
  font-size: 0.97rem;
  font-weight: 600;
  color: #1F2937;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  gap: 12px;
  min-height: 60px;
  transition: color 0.15s;
}

.calc-faq-q:hover {
  color: #1F4E79;
}

.calc-faq-icon {
  flex-shrink: 0;
  transition: transform 0.2s;
  font-size: 0.85rem;
  color: #6B7280;
}

.calc-faq-q[aria-expanded="true"] .calc-faq-icon {
  transform: rotate(180deg);
}

.calc-faq-a {
  font-size: 0.9rem;
  color: #1F2937;
  line-height: 1.7;
  padding-bottom: 18px;
}

/* ── Responsive tweaks ── */
@media (max-width: 480px) {
  .calc-card-wrap {
    padding: 22px 16px 28px;
  }

  .calc-radio-group {
    gap: 8px;
  }

  .calc-radio-card {
    padding: 12px 14px;
  }

  .calc-breakdown-list li {
    flex-direction: column;
    gap: 2px;
  }

  .calc-breakdown-list li .bd-value {
    font-size: 1rem;
  }
}

/* Prevent horizontal overflow on 320px viewport */
@media (max-width: 360px) {
  .calc-main {
    padding: 0 10px 80px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }

  .calc-h1 {
    font-size: 1.4rem;
  }

  .calc-result-number {
    font-size: 2.4rem;
  }

  .calc-btn-next {
    min-width: 120px;
    padding: 14px 18px;
  }
}
