/* ============================================
   REWARDIST TRIP PLANNER — Styles
   ============================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --text: #1A1A1A;
  --text-2: #6B6B6B;
  --accent: #1A3D5C;
  --accent-hover: #142F47;
  --accent-light: #E8EFF5;
  --border: #E5E5E3;
  --gold: #D4A853;
  --gold-light: #FBF5E8;
  --success: #2D7A2D;
  --success-light: #E8F5E8;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --serif: 'DM Serif Display', Georgia, serif;
  --max: 680px;
}

html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--sans); color: var(--text); background: var(--bg); line-height: 1.6; }

.container-narrow { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

/* Nav */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(250,250,248,0.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.nav-inner { max-width: 1080px; margin: 0 auto; padding: 0.875rem 1.5rem; display: flex; align-items: center; justify-content: space-between; }
.logo { font-family: var(--sans); font-size: 1.25rem; font-weight: 600; color: var(--text); text-decoration: none; letter-spacing: -0.03em; }
.nav-links { display: flex; gap: 1.5rem; }
.nav-link { font-size: 0.875rem; font-weight: 500; color: var(--text-2); text-decoration: none; }
.nav-link:hover { color: var(--text); }

/* Step header */
.step { padding: 6rem 0 4rem; }
.step-header { text-align: center; margin-bottom: 3rem; }
.eyebrow { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-bottom: 1rem; }
.headline { font-family: var(--serif); font-size: clamp(1.75rem, 4.5vw, 2.75rem); line-height: 1.2; letter-spacing: -0.02em; margin-bottom: 1rem; }
.headline em { font-style: italic; color: var(--accent); }
.subhead { font-size: 1rem; color: var(--text-2); max-width: 520px; margin: 0 auto; line-height: 1.7; }

/* Form */
.planner-form { display: flex; flex-direction: column; gap: 2rem; }
.form-section { border: 1px solid var(--border); border-radius: 12px; padding: 1.75rem; background: var(--surface); }
.form-section legend { font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; padding: 0; }
.field-note { font-size: 0.8125rem; color: var(--text-2); margin-bottom: 1rem; }

/* Portfolio grid */
.portfolio-grid { display: grid; grid-template-columns: 1fr; gap: 0.625rem; }
.portfolio-item { cursor: pointer; }
.portfolio-item input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.portfolio-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 1rem; border: 1.5px solid var(--border); border-radius: 8px; transition: all 0.15s; }
.portfolio-item input[type="checkbox"]:checked + .portfolio-card { border-color: var(--accent); background: var(--accent-light); }
.portfolio-name { font-size: 0.875rem; font-weight: 600; white-space: nowrap; }
.points-input { width: 130px; padding: 0.5rem 0.75rem; font-family: var(--sans); font-size: 0.8125rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); text-align: right; }
.points-input:disabled { opacity: 0.4; cursor: not-allowed; }
.points-input:not(:disabled) { opacity: 1; background: var(--surface); }
.points-input:focus { outline: none; border-color: var(--accent); }

/* Fields */
.field { display: flex; flex-direction: column; gap: 0.375rem; flex: 1; }
.field label { font-size: 0.8125rem; font-weight: 600; color: var(--text); }
.field input, .field select, .field textarea {
  padding: 0.75rem 0.875rem; font-family: var(--sans); font-size: 0.9375rem;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
  color: var(--text); transition: border-color 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.field textarea { resize: vertical; min-height: 80px; }
.field-row { display: flex; gap: 1rem; }

/* Submit */
.submit-btn {
  padding: 1rem 2rem; font-family: var(--sans); font-size: 1rem; font-weight: 700;
  color: #FFF; background: var(--accent); border: none; border-radius: 10px;
  cursor: pointer; transition: background 0.2s, transform 0.1s; text-align: center;
}
.submit-btn:hover { background: var(--accent-hover); }
.submit-btn:active { transform: scale(0.98); }
.submit-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #FFF; border-radius: 50%; animation: spin 0.6s linear infinite; vertical-align: middle; margin-right: 0.5rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Results */
.step-results { padding-top: 6rem; }
.results-header { text-align: center; margin-bottom: 2.5rem; }
.results-body { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; margin-bottom: 2.5rem; }
.results-body h3 { font-family: var(--serif); font-size: 1.375rem; margin: 2rem 0 0.75rem; color: var(--text); }
.results-body h3:first-child { margin-top: 0; }
.results-body h4 { font-size: 0.9375rem; font-weight: 700; margin: 1.5rem 0 0.5rem; color: var(--accent); }
.results-body p { font-size: 0.9375rem; color: var(--text-2); line-height: 1.75; margin-bottom: 0.75rem; }
.results-body ul, .results-body ol { margin: 0.5rem 0 1rem 1.25rem; }
.results-body li { font-size: 0.9375rem; color: var(--text-2); line-height: 1.7; margin-bottom: 0.375rem; }
.results-body strong { color: var(--text); font-weight: 600; }
.results-body .savings-callout {
  background: var(--gold-light); border: 1px solid var(--gold); border-radius: 8px;
  padding: 1.25rem; margin: 1.5rem 0; text-align: center;
}
.results-body .savings-callout .big-number { font-family: var(--serif); font-size: 2rem; color: var(--text); display: block; margin-bottom: 0.25rem; }
.results-body .savings-callout p { margin: 0; font-size: 0.875rem; }
.results-body .tip-box {
  background: var(--accent-light); border-radius: 8px; padding: 1rem 1.25rem; margin: 1rem 0;
}
.results-body .tip-box p { margin: 0; font-size: 0.875rem; color: var(--accent); }
.results-body .tip-box strong { color: var(--accent); }

/* Results footer CTAs */
.results-footer { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.cta-box, .newsletter-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.75rem; text-align: center;
}
.cta-box h3, .newsletter-box h3 { font-family: var(--serif); font-size: 1.25rem; margin-bottom: 0.5rem; }
.cta-box p, .newsletter-box p { font-size: 0.875rem; color: var(--text-2); margin-bottom: 1rem; }
.cta-btn {
  display: inline-block; padding: 0.75rem 1.5rem; font-family: var(--sans); font-size: 0.9375rem;
  font-weight: 600; color: #FFF; background: var(--gold); border-radius: 8px; text-decoration: none;
  transition: background 0.2s;
}
.cta-btn:hover { background: #C29A45; }
.cta-note { font-size: 0.8125rem; color: var(--text-2); margin-top: 0.75rem; }
.link-btn { background: none; border: none; color: var(--accent); text-decoration: underline; cursor: pointer; font-size: 0.8125rem; font-family: var(--sans); }
.inline-form { display: flex; gap: 0.5rem; }
.inline-form input { flex: 1; padding: 0.75rem; font-family: var(--sans); font-size: 0.875rem; border: 1px solid var(--border); border-radius: 8px; }
.inline-form button { padding: 0.75rem 1.25rem; font-family: var(--sans); font-weight: 600; font-size: 0.875rem; color: #FFF; background: var(--accent); border: none; border-radius: 8px; cursor: pointer; white-space: nowrap; }

/* Footer */
.footer { padding: 2rem 0; border-top: 1px solid var(--border); margin-top: 3rem; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }
.footer-logo { font-size: 1rem; font-weight: 600; letter-spacing: -0.03em; }
.footer-copy { font-size: 0.8125rem; color: var(--text-2); }

/* Responsive */
@media (min-width: 640px) {
  .portfolio-grid { grid-template-columns: 1fr 1fr; }
  .results-footer { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .field-row { flex-direction: column; }
  .inline-form { flex-direction: column; }
  .points-input { width: 100px; }
}

/* ---- Email Gate Modal ---- */
.email-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(26, 26, 26, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.email-gate-overlay.visible {
  opacity: 1;
}

.email-gate-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.3s ease;
}

.email-gate-overlay.visible .email-gate-modal {
  transform: translateY(0) scale(1);
}

.email-gate-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.email-gate-headline {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.email-gate-sub {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.email-gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.email-gate-form input[type="email"] {
  padding: 0.875rem 1rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  text-align: center;
  transition: border-color 0.15s;
}

.email-gate-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.email-gate-form input[type="email"].input-error {
  border-color: #D94F4F;
  animation: gate-shake 0.4s ease;
}

.email-gate-btn {
  padding: 0.875rem 1.5rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  color: #FFF;
  background: var(--gold);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.email-gate-btn:hover {
  background: #C29A45;
}

.email-gate-btn:active {
  transform: scale(0.98);
}

.email-gate-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.email-gate-note {
  font-size: 0.75rem;
  color: var(--text-2);
  margin-top: 1rem;
  line-height: 1.5;
}

.email-gate-error {
  font-size: 0.8125rem;
  color: #D94F4F;
  margin-top: 0.5rem;
}

@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@media (max-width: 480px) {
  .email-gate-modal {
    padding: 2rem 1.5rem;
  }
  .email-gate-headline {
    font-size: 1.3rem;
  }
}
