/*
  CrossInsure - Redesigned Styles
  J. Ive - 2025
*/

:root {
    --ease-in-out-quad: cubic-bezier(0.455, 0.03, 0.515, 0.955);
    --ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1);
    --color-background: #f5f5f7;
    --color-text: #1d1d1f;
    --color-text-light: #6e6e73;
    --color-primary: #007aff;
    --color-primary-hover: #0071e3;
    --color-white: #fff;
    --color-border: #d2d2d7;
    --color-border-focus: #a5a5a5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    margin: 0;
    background-color: var(--color-background);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 22px;
}

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--color-border);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 52px;
}

.logo {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-text);
    text-decoration: none;
}

.nav-links a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 14px;
    margin-left: 2em;
    transition: color 0.3s var(--ease-out-quart);
}

.nav-links a:hover {
    color: var(--color-primary);
}

/* --- Buttons --- */
.cta-button, .button-secondary {
    border: none;
    padding: 10px 20px;
    border-radius: 980px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-quart);
}

.cta-button {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.cta-button:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
}

.button-secondary {
    background-color: #e8e8ea;
    color: var(--color-text);
}

.button-secondary:hover {
    background-color: #dcdce0;
    transform: translateY(-1px);
}


/* --- Hero & Sections --- */
.hero {
    text-align: center;
    padding: 60px 0 80px;
    background-color: var(--color-white);
}

.hero-title {
    font-size: 56px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.1;
    margin-bottom: 16px;
    color: var(--color-text);
}

.hero-subtitle {
    font-size: 24px;
    line-height: 1.33;
    font-weight: 400;
    max-width: 680px;
    margin: 0 auto 24px;
    color: var(--color-text-light);
}

.section {
    padding: 60px 0;
    text-align: center;
}

.section-title {
    font-size: 40px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin-bottom: 12px;
}

.section-subtitle {
    font-size: 21px;
    line-height: 1.4;
    max-width: 680px;
    margin: 0 auto;
    color: var(--color-text-light);
}

.story-section {
    background-color: var(--color-white);
}

.story-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    margin-top: 50px;
    text-align: left;
}

.story-text h3 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 16px;
}

.story-text p {
    font-size: 19px;
    line-height: 1.5;
    color: var(--color-text-light);
}

.story-image {
    width: 100%;
    height: auto;
    border-radius: 24px;
    box-shadow: 0 16px 32px rgba(0,0,0,0.05);
    object-fit: cover;
}

/* --- Quote Form --- */
#quote.section {
    padding-top: 60px;
    padding-bottom: 80px;
}

.quote-form-container {
    background-color: var(--color-white);
    border-radius: 24px;
    padding: 40px;
    margin-top: 30px;
    text-align: left;
    box-shadow: 0 16px 32px rgba(0,0,0,0.05);
}

/* --- Step Indicator --- */
.step-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 0 20px;
}

.step {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-light);
    transition: color 0.4s var(--ease-out-quart);
}

.step.active {
    color: var(--color-text);
    font-weight: 600;
}

.step-line {
    flex-grow: 1;
    height: 1px;
    background-color: var(--color-border);
    margin: 0 15px;
}


/* --- Form Elements --- */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeIn 0.5s var(--ease-out-quart);
}

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

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    font-size: 17px;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: var(--color-background);
    transition: border-color 0.3s var(--ease-out-quart), box-shadow 0.3s var(--ease-out-quart);
}

.form-group select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.form-group input::placeholder {
    color: #a5a5a5;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
    border-top: 1px solid #e8e8ea;
    padding-top: 20px;
}

/* --- Vehicle Image Preview --- */
.vehicle-image-preview {
    height: 250px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-background);
    border-radius: 18px;
    overflow: hidden;
    transition: height 0.4s var(--ease-out-quart);
}

.vehicle-image-preview:empty {
    height: 0;
    margin-bottom: 0;
}

.vehicle-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: fadeIn 0.5s var(--ease-out-quart);
}

/* --- Review Content --- */
#reviewContent {
    background-color: var(--color-background);
    border-radius: 18px;
    padding: 20px;
    font-size: 17px;
    line-height: 1.6;
}
#reviewContent h3 {
    font-size: 21px;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 16px;
    color: var(--color-text);
}
#reviewContent p {
    margin: 0.5em 0;
    color: var(--color-text-light);
}
#reviewContent strong {
    color: var(--color-text);
}


/* --- Footer --- */
.footer {
    background-color: var(--color-white);
    padding: 40px 0;
    text-align: center;
    font-size: 12px;
    color: var(--color-text-light);
    border-top: 1px solid var(--color-border);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-title { font-size: 40px; }
    .hero-subtitle { font-size: 19px; }
    .story-grid { grid-template-columns: 1fr; }
    .story-grid > div:first-child { order: 2; }
    .story-grid > div:last-child { order: 1; }
    .form-grid { grid-template-columns: 1fr; }
    .form-group.full-width { grid-column: span 1; }
    .quote-form-container { padding: 20px; }

    /* Button responsiveness */
    .form-actions {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .form-actions button {
        width: 100%;
        padding: 14px 20px !important;
        font-size: 16px !important;
    }

    .cta-button, .button-secondary {
        width: 100%;
        text-align: center;
        display: inline-block;
        box-sizing: border-box;
    }

    /* Step indicator mobile - show fewer steps or make scrollable */
    .step-indicator {
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 10px 10px;
        margin-bottom: 20px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .step {
        font-size: 12px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .step-line {
        min-width: 20px;
        margin: 0 8px;
    }

    /* Navigation mobile */
    .nav-links a {
        font-size: 13px;
        margin-left: 1em;
    }

    /* Review page mobile responsiveness */
    #reviewContent [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    #reviewContent [style*="display: flex"] {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero {
        padding: 40px 0 60px;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-subtitle {
        font-size: 17px;
    }

    .section-title {
        font-size: 28px;
    }

    .section-subtitle {
        font-size: 17px;
    }

    .quote-form-container {
        padding: 16px;
        border-radius: 18px;
    }

    /* Even smaller buttons on very small screens */
    .form-actions button {
        padding: 12px 16px !important;
        font-size: 15px !important;
    }

    /* Hide step names on very small screens, show only numbers/dots */
    .step-indicator {
        justify-content: center;
    }

    .step {
        font-size: 0;
        width: 10px;
        height: 10px;
        background-color: var(--color-border);
        border-radius: 50%;
        padding: 0;
        transition: all 0.3s var(--ease-out-quart);
    }

    .step.active {
        background-color: var(--color-primary);
        width: 12px;
        height: 12px;
    }

    .step-line {
        min-width: 15px;
        max-width: 30px;
        margin: 0 6px;
    }
}