/* ============================================================
   index.css — 3A Rent Car homepage styles
   Extracted from inline <style> for caching + LCP optimization
   Mobile usability optimized: 16px+ form fonts, 44px+ tap targets
   ============================================================ */

html { -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #fafafa;
    color: #111827;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden; /* prevent rogue horizontal scroll */
}
img, svg { max-width: 100%; height: auto; }
* { -webkit-tap-highlight-color: rgba(15,26,46,0.1); }

/* ─── Hero Section (LCP-critical) ─── */
.hero-bg {
    background-color: #0f1a2e;
    color: white;
    padding: 3rem 1rem 2.5rem;
    text-align: center;
    min-height: auto;
    position: relative;
    overflow: hidden;
}
.hero-bg .hero-img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: 0;
}
.hero-bg .hero-overlay {
    position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(170deg, rgba(15,26,46,0.94) 0%, rgba(26,105,133,0.82) 100%);
}
.hero-bg > .container { position: relative; z-index: 2; }
.hero-bg::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 80px; z-index: 3;
    background: linear-gradient(to top, #fafafa, transparent);
    pointer-events: none;
}
@media (min-width: 700px) {
    .hero-bg {
        padding: 2rem 2rem 3rem;
        min-height: 400px;
    }
    .hero-bg .hero-overlay {
        background: linear-gradient(80deg, rgba(15, 26, 46, 0.90) 0%, rgb(26 105 133 / 0%) 100%);
    }
}
.hero-bg h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.hero-bg h1 .accent { color: #c9a84c; }

/* ─── Booking Bar ─── */
.hero-form-container {
    background-color: white;
    padding: 1.5rem 1.75rem;
    border-radius: 1rem;
    box-shadow: 0 24px 48px -12px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.03);
    max-width: 1200px;
    margin: 0 auto;
    color: #111827;
}
.hero-form-container h2 {
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    color: #6b7280;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.booking-bar { display: flex; align-items: center; gap: 0; }
.booking-bar .bb-section {
    flex: 1;
    padding: 0.625rem 1rem;
    border-right: 1px solid #e5e7eb;
    min-width: 0;
    min-height: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.booking-bar .bb-section:last-child { border-right: none; }
.booking-bar .bb-section.bb-toggle {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.875rem;
    min-height: 56px;
}
.booking-bar .bb-section.bb-btn {
    flex: 0 0 auto;
    padding: 0;
    border-right: none;
}
.bb-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #6b7280;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
}
.bb-select,
.bb-input {
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    line-height: 1.4;
    min-height: 24px;
}
input[type="date"].bb-input {
    position: relative;
    cursor: pointer;
}
input[type="date"].bb-input::-webkit-calendar-picker-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.bb-select:focus,
.bb-input:focus { outline: none; }

.bb-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    padding-right: 1rem;
}
.bb-input { cursor: pointer; }
.bb-input::placeholder { color: #9ca3af; }

/* ─── Buttons ─── */
.btn-primary {
    background-color: #0f1a2e;
    color: white;
    padding: 0.95rem 1.75rem;
    border: none;
    border-radius: 0.625rem;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 48px;
}
.btn-primary:hover {
    background-color: #1a2f4d;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(15,26,46,0.25);
}
.btn-primary:focus-visible {
    outline: 3px solid rgba(201,168,76,0.5);
    outline-offset: 2px;
}
.btn-primary svg { width: 1.1rem; height: 1.1rem; }

/* ─── Reusable badge classes (replace inline font-size:10/11px) ─── */
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding: 5px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}
.badge-pill--neutral { background: #f3f4f6; color: #4b5563; }
.badge-pill--warm    { background: #f59e0b; color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.badge-pill--hot     { background: #ea580c; color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.badge-pill--gold    { background: #c9a84c; color: #0f1a2e; }

/* ─── "Identique" inline button (was inline style) ─── */
.btn-identique {
    cursor: pointer;
    color: #c9a227;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 14px;
    border: 1.5px solid #c9a227;
    border-radius: 50px;
    background: transparent;
    transition: all 0.2s ease;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
}
.btn-identique:hover,
.btn-identique:focus-visible {
    background: #c9a227;
    color: #fff;
    outline: none;
}

/* ─── Dropoff row + toggle ─── */
.bb-dropoff-row {
    padding: 0.5rem 1rem 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 0.5rem;
}
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 44px;
    flex-shrink: 0;
    cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
    position: relative;
    cursor: pointer;
    width: 44px;
    height: 24px;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 24px;
    display: block;
}
.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
input:checked + .toggle-slider { background-color: #c9a84c; }
input:checked + .toggle-slider:before { transform: translateX(20px); }
.toggle-switch input:focus-visible + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(201,168,76,0.3);
}

/* ─── Mobile responsive ─── */
@media (max-width: 768px) {
    .hero-bg {
        padding: 2rem 0.75rem 2rem;
    }
    .hero-form-container {
        padding: 1rem 1rem;
        margin: 0;
        border-radius: 1rem;
    }
    .hero-form-container h2 {
        font-size: 0.875rem;
        margin-bottom: 0.875rem;
        letter-spacing: 0.05em;
    }
    .booking-bar { flex-direction: column; gap: 0; }
    .booking-bar .bb-section {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #f3f4f6;
        padding: 0.875rem 0.5rem;
        min-height: 64px;
    }
    .booking-bar .bb-section:last-child { border-bottom: none; }
    .booking-bar .bb-section.bb-toggle {
        min-height: 56px;
        padding: 0.875rem 0.75rem;
        flex-direction: row;
        align-items: center;
        justify-content: center;
    }
    /* Force the toggle label inline on mobile (override the <br>) */
    #toggleLabel {
        font-size: 0.95rem !important;
        line-height: 1.2;
        font-weight: 600;
        color: #374151;
    }
    #toggleLabel br { display: none; }
    .booking-bar .bb-section.bb-btn { padding: 0.875rem 0 0.25rem; }
    .bb-label {
        font-size: 0.75rem;
        margin-bottom: 0.4rem;
    }
    /* Center the "Lieu de retour" label + Identique button when shown */
    #dropoffSection .bb-label {
        justify-content: center !important;
        text-align: center;
        gap: 10px;
    }
    /* CRITICAL: 16px+ on mobile prevents iOS auto-zoom on focus */
    .bb-select,
    .bb-input {
        font-size: 16px;
        min-height: 28px;
    }
    .btn-primary {
        width: 100%;
        justify-content: center;
        padding: 1rem;
        font-size: 0.95rem;
        min-height: 52px;
    }
}

/* ─── Touch-only states (no hover on mobile) ─── */
@media (hover: none) {
    .car-card:hover { transform: none; }
    .btn-primary:hover { transform: none; box-shadow: none; }
    .btn-primary:active {
        background-color: #1a2f4d;
        transform: scale(0.98);
    }
}

/* ─── Misc ─── */
.car-card { transition: transform 0.2s ease-in-out; }
.car-card:hover { transform: translateY(-4px); }

.icon-check::before { content: "✓"; color: #10b981; margin-right: 0.25rem; }
.icon-car::before { content: "🚗"; margin-right: 0.25rem; }
.icon-support::before { content: "📞"; margin-right: 0.25rem; }

[x-cloak] { display: none !important; }

@keyframes barGrow { to { transform: scaleX(1); } }

/* ─── Language banner (replaces server-side redirect) ─── */
.lang-banner {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(15, 26, 46, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    padding: 10px 14px 10px 16px;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    z-index: 999;
    display: none;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    max-width: calc(100vw - 24px);
    border: 1px solid rgba(201,168,76,0.3);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity .35s ease, transform .35s ease;
    pointer-events: none;
}
.lang-banner.visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.lang-banner.fade-out {
    opacity: 0;
    transform: translateY(-10px);
}
.lang-banner span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}
.lang-banner a {
    color: #0f1a2e;
    background: #c9a84c;
    text-decoration: none;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 50px;
    transition: all .2s;
    flex-shrink: 0;
    font-size: 0.78rem;
}
.lang-banner a:hover { background: #fff; transform: scale(1.05); }
.lang-banner button {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
    transition: background .2s;
}
.lang-banner button:hover,
.lang-banner button:focus-visible { background: rgba(255,255,255,0.2); outline: none; }
.lang-banner a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (max-width: 640px) {
    .lang-banner {
        top: auto;
        bottom: 16px;
        left: 12px;
        right: 12px;
        max-width: none;
        padding: 10px 12px;
        font-size: 0.78rem;
        gap: 8px;
    }
    .lang-banner span {
        max-width: none;
        flex: 1;
        white-space: normal;
        line-height: 1.3;
    }
    .lang-banner a {
        padding: 5px 10px;
        font-size: 0.72rem;
    }
}
