/* ========================================
   Fernandina Detailing Quiz Funnel Styles
   High-performance, mobile-first design
   ======================================== */

/* CSS Variables for easy customization */
:root {
    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-primary: #d1151a;
    --color-secondary: #fed98f;
    --color-accent: #fed98f;
    --color-gold: #fed98f;
    --color-navy: #d1151a;
    --color-danger: #ff0000;
    --font-primary: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition-speed: 0.3s;
    --border-radius: 12px;
    --shadow-card: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Typography */
h1 {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    color: var(--color-text);
}

h2 {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

h3 {
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-text);
}

p {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.text-center {
    text-align: center;
}

.text-small {
    font-size: 14px;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.container-sm {
    max-width: 800px;
}

.content {
    position: relative;
    z-index: 10;
    min-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 1.5rem;
    background-color: var(--color-bg);
}

/* Header */
.header {
    padding: 0.5rem 1.5rem;
    background: transparent;
}

.logo {
    height: 40px;
    width: auto;
}

/* Question Counter */
.question-counter {
    font-size: 14px;
    color: rgba(0, 45, 105, 0.7);
    margin-bottom: 1rem;
}

/* Vehicle Selection Cards */
.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .vehicle-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

.vehicle-card {
    background: #f8f8f8;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.vehicle-card:hover {
    background: #ffffff;
    border-color: var(--color-primary);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 45, 105, 0.15);
}

.vehicle-card:active {
    transform: translateY(-2px) scale(0.98);
}

.vehicle-icon {
    width: 100%;
    max-width: 120px;
    height: 80px;
    margin: 0 auto 1rem;
    display: block;
    filter: invert(15%) sepia(95%) saturate(6000%) hue-rotate(355deg) brightness(90%) contrast(95%);
}

.vehicle-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
}

/* Pricing Page */
.pricing-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: #f8f8f8;
    border-radius: var(--border-radius);
    border: 2px solid #e0e0e0;
}

.urgency-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff0000, #cc0000);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.price-display {
    margin: 2rem 0;
}

.regular-price {
    position: relative;
    font-size: 24px;
    color: rgba(0, 45, 105, 0.5);
    margin-bottom: 0.5rem;
}

.regular-price::after {
    content: '✗';
    position: absolute;
    top: 50%;
    left: -30px;
    transform: translateY(-50%);
    color: var(--color-danger);
    font-size: 32px;
    font-weight: 700;
}

.regular-price .price {
    text-decoration: line-through;
}

.special-price {
    font-size: 56px;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

.price-label {
    font-size: 14px;
    color: rgba(0, 45, 105, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    font-family: var(--font-primary);
    width: 100%;
    max-width: 400px;
}

.btn-primary {
    background: var(--color-primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(221, 150, 57, 0.4);
}

.btn-primary:active {
    transform: translateY(0) scale(0.95);
}

/* Calendar Container */
.calendar-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    min-height: 600px;
    margin: 2rem auto;
}

#ghl-calendar {
    width: 100%;
    min-height: 500px;
}

/* Thank You Page */
.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    background: var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 45, 105, 0.1);
    z-index: 100;
}

.progress-fill {
    height: 100%;
    background: var(--color-primary);
    transition: width 0.5s ease;
}

/* Footer */
.footer {
    padding: 2rem 1.5rem;
    text-align: center;
    font-size: 12px;
    color: rgba(0, 45, 105, 0.5);
}

.footer a {
    color: rgba(0, 45, 105, 0.7);
    text-decoration: none;
    margin: 0 0.5rem;
}

.footer a:hover {
    color: var(--color-accent);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Fade-in on Scroll Animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 45, 105, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .vehicle-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .special-price {
        font-size: 42px;
    }

    .pricing-container {
        padding: 1.5rem;
    }

    /* Ensure touch targets are at least 44px */
    .vehicle-card {
        min-height: 120px;
        padding: 1rem;
    }

    .btn {
        min-height: 48px;
        padding: 0.875rem 1.5rem;
        font-size: 16px;
    }

    /* Improved tap feedback */
    .vehicle-card:active,
    .btn:active {
        opacity: 0.8;
    }
}

/* Small mobile devices (320px - 374px) */
@media (max-width: 374px) {
    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    .vehicle-grid {
        gap: 0.75rem;
    }

    .vehicle-card {
        padding: 0.75rem;
    }

    .vehicle-icon {
        max-width: 80px;
        height: 60px;
    }

    .vehicle-name {
        font-size: 14px;
    }

    .special-price {
        font-size: 36px;
    }

    .pricing-container {
        padding: 1rem;
    }

    .container {
        padding: 0.75rem;
    }
}

/* Medium mobile devices (375px - 767px) */
@media (min-width: 375px) and (max-width: 767px) {
    .vehicle-icon {
        max-width: 100px;
        height: 70px;
    }
}

/* Tablet and larger (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .vehicle-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }

    .container {
        padding: 1.5rem;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .vehicle-grid {
        gap: 1.5rem;
    }

    .vehicle-card:hover {
        transform: translateY(-6px) scale(1.03);
    }
}

/* Performance: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
