/* ═══════════════════════════════════════════════════════════════════════════
   ExpatAce Global Style Sheet - Gallery White Institutional Design
   ═══════════════════════════════════════════════════════════════════════════
   
   TARGET DEMOGRAPHIC: Americans 55+ ONLY
   - No Canadian references
   - Age-appropriate typography and spacing
   - Professional institutional aesthetic
   
   DESIGN PHILOSOPHY:
   - Clean, minimal, trustworthy
   - Gallery White background (#FAFAFA)
   - Institutional color palette (slate grays, minimal accent)
   - Data-driven, not aspirational
   
   VERSION CONTROL:
   - Never use "FINAL" in filenames
   - Use dated folders for version archive
   - Production files always use stable names (no version suffixes)
   
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────
   GLOBAL DESIGN TOKENS (Source of Truth)
   ───────────────────────────────────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* ── COLOR PALETTE ────────────────────────────────────────────────── */
  /* Primary Colors */
  --gallery-white: #FAFAFA;           /* Background - Pure institutional white */
  --midnight-slate: #2C3E50;          /* Primary text - Deep professional */
  --deep-slate-gray: #2F4F4F;         /* CTA buttons, navigation, primary actions */
  --gold-accent: #C5A059;             /* Logo accent star only */
  
  /* Ink Shades (Text Hierarchy) */
  --ink: #2C3E50;                     /* Primary text */
  --ink2: #34495E;                    /* Secondary headings */
  --ink3: #5D6D7E;                    /* Body text, descriptions */
  --ink4: #85929E;                    /* Muted text, metadata */
  --ink5: #AEB6BF;                    /* Borders, dividers */
  
  /* Borders & Backgrounds */
  --border: #E1E1E1;                  /* Light borders */
  --border2: #CCCCCC;                 /* Medium borders */
  --bg: #FAFAFA;                      /* Base background (Gallery White) */
  --bg2: #F5F5F5;                     /* Secondary background */
  --bg3: #ECECEC;                     /* Tertiary background */
  
  /* Primary Action Color */
  --teal: #2F4F4F;                    /* Buttons, CTAs, links */
  --teal-dark: #1a3030;               /* Hover states */
  --teal-light: #E8EDED;              /* Light backgrounds */
  --teal-pale: #F4F6F6;               /* Pale backgrounds */
  
  /* Status Colors */
  --green: #059669;
  --green-bg: #ecfdf5;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --red: #dc2626;
  --red-bg: #fef2f2;
  
  /* ── SPACING SYSTEM ───────────────────────────────────────────────── */
  --hero-spacing: 48px;               /* Vertical rhythm in hero section */
  --section-spacing: 80px;            /* Between major sections */
  --card-gap: 16px;                   /* Gap between cards */
  --content-padding: 24px;            /* Standard content padding */
  
  /* ── TYPOGRAPHY SCALE ─────────────────────────────────────────────── */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  
  /* ── BORDER RADIUS ────────────────────────────────────────────────── */
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  
  /* ── SHADOWS ──────────────────────────────────────────────────────── */
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 6px rgba(0,0,0,0.05), 0 10px 40px rgba(0,0,0,0.10);
}

/* ─────────────────────────────────────────────────────────────────────────
   BASE STYLES
   ───────────────────────────────────────────────────────────────────────── */

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: var(--gallery-white);
  color: var(--midnight-slate);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ─────────────────────────────────────────────────────────────────────────
   SCREEN MANAGEMENT
   ───────────────────────────────────────────────────────────────────────── */

.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: block;
}

/* ─────────────────────────────────────────────────────────────────────────
   NAVIGATION
   ───────────────────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(250, 250, 250, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--content-padding);
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-link {
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s;
  text-transform: uppercase;
  letter-spacing: 2px;              /* Required: 2px letter-spacing on all-caps nav links */
  opacity: 0.8;
  line-height: 1;
}

.nav-link:hover {
  opacity: 1;
}

.nav-cta {
  background: var(--deep-slate-gray);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 9px 22px;
  border-radius: 2px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
  letter-spacing: 0.01em;
  line-height: 1;
}

.nav-cta:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .nav-links {
    display: none;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   HERO SECTION - Gallery White Design
   ───────────────────────────────────────────────────────────────────────── */

#screen-home {
  padding-top: 60px;
}

.hero {
  background: var(--gallery-white);
  border-bottom: 1px solid var(--border);
  padding: 80px var(--content-padding) 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(47,79,79,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
}

.hero-badge {
  display: inline-block;
  background: rgba(47,79,79,0.08);
  border: 1px solid rgba(47,79,79,0.20);
  color: var(--deep-slate-gray);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.hero-eyebrow {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink3);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5.2rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  color: var(--midnight-slate);
}

.hero-subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--ink3);
}

.hero-tagline {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--deep-slate-gray);
  letter-spacing: 0.02em;
  margin-bottom: var(--hero-spacing);
}

/* ─────────────────────────────────────────────────────────────────────────
   ENTRY CARDS - Critical Alignment Fixes
   ───────────────────────────────────────────────────────────────────────── */

.entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--card-gap);
  max-width: 620px;
  margin: 0 auto;
  margin-bottom: 24px;              /* FIXED: Reduced from 40px to bring trust bar closer */
}

@media (max-width: 560px) {
  .entry-grid {
    grid-template-columns: 1fr;
  }
}

.entry-card {
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  padding: 24px 20px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 240px;                /* Ensures consistent card height */
}

.entry-card:hover {
  border-color: var(--deep-slate-gray);
  box-shadow: var(--shadow-lg);
}

.entry-card-tag {
  position: absolute;
  top: -8px;
  left: 20px;
  background: var(--deep-slate-gray);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px;
}

.entry-card-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
  display: block;
}

.entry-card-title {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  line-height: 1.3;
}

.entry-card-sub {
  font-size: 0.8rem;
  color: var(--ink4);
  line-height: 1.55;
  margin-bottom: 14px;
  flex-grow: 1;                     /* Pushes CTA to bottom */
}

.entry-card-cta {
  margin-top: auto;                 /* FIXED: Forces bottom alignment regardless of content above */
  width: 100%;
  background: var(--deep-slate-gray);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  text-align: left;                 /* FIXED: Left-align CTA text */
}

.entry-card-cta:hover {
  background: var(--teal-dark);
}

.entry-card-cta-secondary {
  background: transparent;
  color: var(--deep-slate-gray);
  border: 2px solid var(--deep-slate-gray);
}

.entry-card-cta-secondary:hover {
  background: var(--deep-slate-gray);
  color: #fff;
}

/* ─────────────────────────────────────────────────────────────────────────
   TRUST BAR - Positioning Fix
   ───────────────────────────────────────────────────────────────────────── */

.hero-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px 0;                  /* FIXED: Reduced from 24px to pull closer to cards */
  margin-top: 0;                    /* FIXED: Removed 40px top margin */
}

.trust-item {
  font-size: 0.75rem;
  color: var(--ink4);
}

/* ─────────────────────────────────────────────────────────────────────────
   SECTIONS
   ───────────────────────────────────────────────────────────────────────── */

.section {
  padding: var(--section-spacing) var(--content-padding);
}

.section-alt {
  background: var(--bg2);
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink4);
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--ink);
}

.section-sub {
  font-size: 1.05rem;
  color: var(--ink3);
  line-height: 1.7;
  margin-bottom: 44px;
  font-weight: 400;
  max-width: 660px;
}

/* ─────────────────────────────────────────────────────────────────────────
   STEPS GRID
   ───────────────────────────────────────────────────────────────────────── */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.step-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: left;
  position: relative;
}

.step-num {
  position: absolute;
  top: -12px;
  left: 24px;
  background: var(--deep-slate-gray);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 16px;
}

.step-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
  line-height: 1.3;
}

.step-desc {
  font-size: 0.88rem;
  color: var(--ink3);
  line-height: 1.6;
}

/* ─────────────────────────────────────────────────────────────────────────
   NEWSLETTER
   ───────────────────────────────────────────────────────────────────────── */

.newsletter {
  background: var(--deep-slate-gray);
  padding: 72px var(--content-padding);
  text-align: center;
  color: #fff;
}

.newsletter-inner {
  max-width: 540px;
  margin: 0 auto;
}

.newsletter-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.newsletter-sub {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.6;
  margin-bottom: 24px;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.newsletter-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 0.95rem;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-family: inherit;
}

.newsletter-input::placeholder {
  color: rgba(255,255,255,0.5);
}

.newsletter-btn {
  background: #fff;
  color: var(--deep-slate-gray);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s;
}

.newsletter-btn:hover {
  transform: translateY(-2px);
}

.newsletter-fine {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  margin-top: 8px;
}

/* ─────────────────────────────────────────────────────────────────────────
   QUIZ STYLES
   ───────────────────────────────────────────────────────────────────────── */

.quiz-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 20px var(--content-padding);
}

.quiz-meta {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.quiz-step-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink3);
}

.quiz-back {
  background: transparent;
  border: none;
  color: var(--deep-slate-gray);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.quiz-back:hover {
  background: var(--bg2);
}

.progress-bar {
  max-width: 700px;
  margin: 0 auto;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--deep-slate-gray);
  transition: width 0.3s ease;
}

.quiz-body {
  max-width: 700px;
  margin: 0 auto;
  padding: 48px var(--content-padding);
}

/* ─────────────────────────────────────────────────────────────────────────
   LOADING SCREEN
   ───────────────────────────────────────────────────────────────────────── */

#screen-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--content-padding);
}

.loading-globe {
  font-size: 4rem;
  margin-bottom: 24px;
  animation: spin 2s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loading-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--ink);
}

.loading-sub {
  font-size: 0.95rem;
  color: var(--ink3);
  text-align: center;
  margin-bottom: 32px;
}

.loading-dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  background: var(--deep-slate-gray);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ─────────────────────────────────────────────────────────────────────────
   RESULTS SCREEN
   ───────────────────────────────────────────────────────────────────────── */

.results-hero {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 60px var(--content-padding);
  text-align: center;
}

.results-hero-inner {
  max-width: 700px;
  margin: 0 auto;
}

.results-badge {
  display: inline-block;
  background: var(--deep-slate-gray);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.results-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--ink);
}

.results-sub {
  font-size: 1rem;
  color: var(--ink3);
  line-height: 1.6;
}

.results-body {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px var(--content-padding);
}

.email-card {
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-align: center;
  margin: 32px 0;
}

.email-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
}

.email-sub {
  font-size: 0.9rem;
  color: var(--ink3);
  line-height: 1.6;
  margin-bottom: 24px;
}

.email-form {
  max-width: 400px;
  margin: 0 auto;
}

.email-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 0.95rem;
  border: 2px solid var(--border2);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  margin-bottom: 12px;
}

.btn-email {
  width: 100%;
  background: var(--deep-slate-gray);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.15s;
}

.btn-email:hover {
  background: var(--teal-dark);
  transform: translateY(-2px);
}

.email-fine {
  font-size: 0.75rem;
  color: var(--ink4);
  margin-top: 8px;
}

.email-success {
  display: none;
  background: var(--green-bg);
  color: var(--green);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 16px;
}

.btn-retake {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 16px auto;
  background: transparent;
  color: var(--deep-slate-gray);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--deep-slate-gray);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-retake:hover {
  background: var(--deep-slate-gray);
  color: #fff;
}

/* ─────────────────────────────────────────────────────────────────────────
   MODAL
   ───────────────────────────────────────────────────────────────────────── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.modal-box {
  background: #fff;
  border-radius: var(--radius);
  max-width: 500px;
  margin: 60px auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--ink4);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.modal-search {
  width: 100%;
  padding: 14px 24px;
  font-size: 0.95rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  font-family: inherit;
}

.modal-list {
  max-height: 400px;
  overflow-y: auto;
}

/* ─────────────────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────────────────── */

.site-footer {
  background: var(--deep-slate-gray);
  color: rgba(255,255,255,0.8);
  padding: 48px var(--content-padding);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #fff;
  margin-bottom: 20px;
}

.footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: #fff;
}

.footer-copy {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════
   END OF GLOBAL STYLE SHEET
   ═══════════════════════════════════════════════════════════════════════════ */
