:root {
    --primary-navy: #1B365D;
    --primary-gold: #D4A574;
    --text-gray: #666666;
    --light-bg: #F8F9FB;
    --accent-blue: #2E4A6B;
    --success-green: #10B981;
    --error-red: #EF4444;

    /* Background gradient options */
    --gradient-current: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --gradient-brand: linear-gradient(135deg, #1a365d 0%, #2d4a6b 50%, #0a3161 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Optimize font loading for better LCP */
* {
    font-display: swap;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    background: var(--gradient-current);
    background-attachment: fixed;
    background-size: cover;
    font-size: 20px;
    line-height: 1.6;
    color: #2d3748;
}

/* Background gradient toggle options for split testing */
body.variant-current {
    background: var(--gradient-current);
}

body.variant-brand {
    background: var(--gradient-brand);
}

main {
    flex: 1;
    display: flex;
    justify-content: space-between;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.left-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem; /* Reduced from default spacing */
}

.right-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.cta-banner {
    text-align: center;
    margin-bottom: 1rem;
}

.cta-banner h3 {
    font-size: 1.25rem;
    color: #374151;
    margin-bottom: 0.5rem;
    font-weight: 600;
    opacity: 0.9;
}

.cta-banner p {
    font-size: 1rem;
    color: var(--text-gray);
    line-height: 1.5;
    max-width: 400px;
}

.mobile-cta-button {
    display: none;
    background: linear-gradient(135deg, var(--primary-navy) 0%, var(--accent-blue) 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(27, 54, 93, 0.3);
    transition: all 0.3s ease;
    margin: 1.5rem 0;
    width: 100%;
    max-width: 300px;
}

.mobile-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(27, 54, 93, 0.4);
}

.quote-card {
    background: white;
    padding: 2.5rem;
    border-radius: 1.25rem;
    box-shadow: 0 12px 32px rgba(27, 54, 93, 0.12);
    width: 100%;
    max-width: 400px;
    position: relative;
    border: 1px solid rgba(212, 165, 116, 0.2);
}

.logo {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--primary-navy);
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(27, 54, 93, 0.1);
}

.logo .plan {
    color: var(--primary-gold);
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--primary-navy);
}

.highlight-gold {
    color: var(--primary-gold);
}

.quiz-intro {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--primary-navy);
    font-weight: 700;
}

.subtitle {
    color: #4a5568;
    font-size: 1.2rem;
    line-height: 1.5;
    margin-bottom: 2rem;
    font-weight: 500;
}

.trust-badges {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--light-bg);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(212, 165, 116, 0.2);
    font-size: 0.9rem;
    color: var(--primary-navy);
    font-weight: 500;
}

.trust-badge .icon {
    width: 20px;
    height: 20px;
    color: var(--primary-gold);
}

.profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-navy) 0%, var(--accent-blue) 100%);
    border: 2px solid var(--primary-gold);
}

.profile-name {
    font-size: 0.9rem;
    color: var(--text-gray);
    font-weight: 500;
}

.quiz-avatar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.quiz-avatar img {
    height: 90px;
    width: 90px;
    border-radius: 50%;
    object-fit: contain;
    border: 2px solid var(--primary-gold);
    background: white;
}

.avatar-name {
    font-weight: 600;
    color: var(--primary-navy);
    font-size: 1.1rem;
    margin-top: 0.5rem;
    text-align: center;
}

.avatar-title {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 500;
    margin-top: 0.25rem;
    line-height: 1.2;
    text-align: center;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
    font-style: italic;
}

h2 {
    font-size: 1.7rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--primary-navy);
    font-weight: 600;
}

.gender-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.gender-button {
    flex: 1;
    padding: 1.75rem;
    border: 2px solid #e5e5e5;
    border-radius: 0.75rem;
    background: #ffffff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: 600;
    min-height: 4rem;
}

.gender-button:hover {
    border-color: var(--primary-gold);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.2);
}

.gender-button.selected {
    background: linear-gradient(135deg, var(--light-bg) 0%, rgba(212, 165, 116, 0.1) 100%);
    border-color: var(--primary-gold);
    box-shadow: 0 4px 16px rgba(212, 165, 116, 0.3);
}

.gender-button .icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-navy) 0%, var(--accent-blue) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.counter {
    background: linear-gradient(135deg, var(--light-bg) 0%, rgba(212, 165, 116, 0.1) 100%);
    padding: 1rem;
    border-radius: 0.75rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--primary-navy);
    margin-top: 1.5rem;
    border: 1px solid rgba(212, 165, 116, 0.2);
}

footer {
    text-align: center;
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-top: 2rem;
}

footer a {
    color: var(--primary-gold);
    text-decoration: none;
}

.progress-container {
    width: 100%;
    height: 6px;
    background: #E5E7E5;
    border-radius: 3px;
    margin: 1.5rem 0;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary-gold) 0%, var(--primary-navy) 100%);
    transition: width 0.4s ease;
    border-radius: 3px;
}

.form-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.form-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.slider-container {
    margin: 2rem 0;
}

.slider-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin: 1rem 0;
}

.slider-marker {
    font-size: 0.9rem;
    color: var(--text-gray);
    font-weight: 500;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    padding: 0.25rem 0.5rem;
    z-index: 1;
}

.slider-marker-min {
    left: -2rem;
}

.slider-marker-max {
    right: -2.5rem;
}

.slider-legend {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-gray);
    font-weight: 500;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.slider-value {
    text-align: center;
    font-size: 1.7rem;
    color: var(--primary-navy);
    margin-bottom: 1rem;
    font-weight: 600;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.age-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 1.5rem 0;
    width: 100%;
}

.slider {
    width: 100%;
    -webkit-appearance: none;
    height: 8px;
    background: #E5E7E5;
    outline: none;
    border-radius: 4px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-gold) 0%, var(--primary-navy) 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(27, 54, 93, 0.3);
    position: relative;
    z-index: 2;
}

.option-button {
    width: 100%;
    padding: 1.75rem;
    margin-bottom: 0.75rem;
    border: 2px solid #e5e5e5;
    border-radius: 0.75rem;
    background: white;
    text-align: center;
    cursor: pointer;
    transition: box-shadow .15s, border-color .15s;
    font-weight: 600;
    font-size: 1.1rem;
    min-height: 3.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.coverage-type {
    color: var(--primary-navy);
    font-weight: 600;
    font-size: 1.1rem;
}

.coverage-amount {
    color: #333333;
    font-weight: 500;
    font-size: 0.9rem;
}

.option-button:hover {
    border-color: var(--primary-gold);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.2);
}

.option-button:focus {
    box-shadow: 0 0 0 3px rgba(34,197,94,0.12);
    outline: none;
}

.option-button.selected {
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(212,175,55,0.15), 0 0 0 2px #D4AF37;
    outline: none;
    background: linear-gradient(135deg, var(--light-bg) 0%, rgba(212, 165, 116, 0.1) 100%);
    color: var(--primary-navy);
}

.next-button {
    width: 100%;
    padding: 1.75rem;
    margin-top: 1.5rem;
    border: none;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, var(--primary-navy) 0%, var(--accent-blue) 100%);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(27, 54, 93, 0.3);
    font-size: 1.2rem;
    min-height: 3.5rem;
}

.next-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(27, 54, 93, 0.4);
}

.next-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-gray);
    text-decoration: none;
    margin-top: 1rem;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--primary-gold);
}

.form-input {
    width: 100%;
    padding: 1.4rem;
    border: 2px solid #e5e5e5;
    border-radius: 0.75rem;
    margin-top: 1rem;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    min-height: 2.8rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.consent-text {
    font-size: 0.9rem;
    color: var(--text-gray);
    line-height: 1.4;
    margin-top: 1rem;
    background: rgba(248, 249, 251, 0.8);
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 3px solid var(--primary-gold);
}

.otp-container {
    margin-top: 1rem;
    display: none;
}

.otp-helper {
    font-size: 0.9rem;
    color: #6b7280;
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 500;
}

.otp-container.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.otp-input {
    width: 100%;
    padding: 1.5rem;
    border: 2px solid #e5e5e5;
    border-radius: 0.75rem;
    margin: 1rem 0;
    font-size: 1.5rem;
    line-height: 2rem;
    text-align: center;
    letter-spacing: 0.5rem;
    font-weight: 600;
    background: #ffffff;
}

.otp-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.otp-button {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--primary-gold);
    border-radius: 0.5rem;
    background: white;
    color: var(--primary-navy);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
}

.otp-button:hover {
    background: var(--primary-gold);
    color: white;
}

.otp-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.success-message {
    color: var(--success-green);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message {
    color: var(--error-red);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.validation-error {
    color: var(--error-red);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}

.form-input.error {
    border-color: var(--error-red);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.required-indicator {
    color: var(--error-red);
    font-weight: bold;
    margin-left: 2px;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-gold);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.phone-reassurance {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* Tablet styles */
@media (max-width: 1024px) {
    main {
        gap: 3rem;
        padding: 0 1rem;
    }

    .cta-banner h3 {
        font-size: 1.5rem;
    }

    .cta-banner p {
        font-size: 0.9rem;
    }
}

/* Mobile styles */
@media (max-width: 768px) {
    main {
        flex-direction: column;
        gap: 2rem;
        padding: 0 1rem;
    }

    /* Hero first on mobile and center its content */
    .left-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        order: 1;
    }

    /* Form follows the hero */
    .right-section {
        order: 2;
        gap: 1rem;
    }

    body {
        padding: 1rem;
    }

    .logo {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    h1 {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }

    .subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .trust-badges {
        flex-direction: row;
        justify-content: center;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .trust-badge {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        flex: 0 0 auto;
        min-width: 120px;
    }

    .cta-banner {
        margin-bottom: 0.5rem;
    }

    .cta-banner h3 {
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
    }

    .social-proof {
        font-size: 0.8rem;
        margin: 0.5rem 1rem 0 1rem;
        max-width: none;
    }

    .avatar-name {
        font-size: 1rem;
    }

    .avatar-title {
        font-size: 0.65rem;
        max-width: 180px;
    }

    .quiz-intro {
        font-size: 2rem;
    }

    .age-divider {
        margin: 1rem 0;
    }

    .cta-banner p {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .mobile-cta-button {
        display: block;
    }

    .social-proof {
        font-size: 0.875rem;
        color: #6b7280;
        text-align: center;
        margin: 0.75rem 0 0 0;
        line-height: 1.4;
        font-weight: 500;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .quote-card {
        padding: 1.5rem;
        max-width: 100%;
    }

    .slider-marker-min {
        left: -1.2rem;
        font-size: 0.8rem;
        padding: 0.2rem 0.3rem;
    }

    .slider-marker-max {
        right: -1.5rem;
        font-size: 0.8rem;
        padding: 0.2rem 0.3rem;
    }

    .slider-legend {
        font-size: 0.8rem;
    }

    .gender-button {
        padding: 1.2rem;
        font-size: 0.9rem;
    }

    .option-button {
        padding: 1.2rem;
        font-size: 0.9rem;
    }

    .next-button {
        padding: 1.2rem;
        font-size: 1rem;
    }
}

/* Small mobile styles */
@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }

    .logo {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    .trust-badges {
        gap: 0.5rem;
    }

    .trust-badge {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
        min-width: 100px;
    }

    .cta-banner h3 {
        font-size: 1.2rem;
    }

    .cta-banner p {
        font-size: 0.8rem;
    }

    .quote-card {
        padding: 1.25rem;
    }

    .slider-marker-min,
    .slider-marker-max {
        font-size: 0.75rem;
        padding: 0.15rem 0.25rem;
    }

    .slider-value {
        font-size: 2rem;
    }
}

/* Enhanced focus states for accessibility */
.gender-button:focus,
.option-button:focus,
.next-button:focus,
.otp-button:focus,
.form-input:focus,
.slider:focus {
    outline: 2px solid var(--primary-gold);
    outline-offset: 2px;
}

.back-link:focus {
    outline: 2px solid var(--primary-gold);
    outline-offset: 2px;
}

/* New styles for optimized flow */
.step-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.skip-button {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e5e5e5;
    border-radius: 0.75rem;
    background: #f8f9fb;
    color: var(--text-gray);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.skip-button:hover {
    border-color: var(--primary-gold);
    background: rgba(212, 165, 116, 0.1);
    color: var(--primary-navy);
}

.coverage-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.coverage-options .option-button {
    width: 100%;
}

.health-questions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.question-group {
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 0.5rem;
    border: 1px solid rgba(212, 165, 116, 0.2);
}

.question-group h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--primary-navy);
    font-weight: 600;
}

.small-text {
    font-size: 0.9rem !important;
    color: var(--text-gray) !important;
    margin-bottom: 1rem !important;
}

/* Professional Lucide-style icons */
.icon {
  width: 40px;
  height: 40px;
  stroke-width: 2.25;
  color: var(--primary-navy);
  flex-shrink: 0;
  padding: 2px;
  box-sizing: border-box;
}

.option-button.selected .icon {
  color: var(--primary-gold);
}

.flag-icon {
  width: 64px;
  height: auto;
  border-radius: 4px;
  flex-shrink: 0;
  display: inline-block;
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* OTP Error Messages - High contrast for seniors */
.otp-error-message {
    color: #dc2626;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background-color: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.4;
}

.otp-error-message::before {
    content: "⚠️";
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Edge device responsive optimizations */

/* Smallest devices (≤360px) - Enhanced button readability */
@media (max-width: 360px) {
  .option-button {
    padding: 1rem 0.5rem;
    font-size: 1rem;
    min-height: 4rem;
  }

  .coverage-type {
    font-size: 1rem;
  }

  .coverage-amount {
    font-size: 0.85rem;
  }

  .gender-button {
    padding: 1rem;
    font-size: 0.95rem;
    min-height: 3.5rem;
  }

  .next-button {
    padding: 1.25rem;
    font-size: 1rem;
    min-height: 4rem;
  }
}

/* Tablets (768px–1024px) - Widen quiz card for better balance */
@media (min-width: 768px) and (max-width: 1024px) {
  .quote-card {
    max-width: 500px;
  }
}

/* Large desktops (≥1600px) - Cap content width and center layout */
@media (min-width: 1600px) {
  main {
    max-width: 1400px;
    margin: 0 auto;
  }
}

/* Screen reader only content - for accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}