/**
 * MyBangladesh Flights — search page (/flight)
 * Loaded after theme.css by layouts/main.php on /flight routes. Mobile first:
 * phone → one compact card, sheets from the bottom; 640px → two columns; 1024px → one search row.
 *
 * 1. Hero   2. Search card   3. Fields   4. Travellers sheet   5. Airport picker
 * 6. Benefits   7. Popular routes   8. Motion
 */

/* ==========================================================================
   1. HERO
   ========================================================================== */
.fl-page {
    overflow-x: clip;
    padding-bottom: 8px;
}

.fl-hero {
    position: relative;
    isolation: isolate;
    padding: 20px 0 76px;                /* the search card overlaps the lower edge */
    border-radius: 0 0 28px 28px;
    color: #ffffff;
    background:
        linear-gradient(100deg, rgba(6, 44, 32, 0.96) 0%, rgba(6, 44, 32, 0.84) 46%, rgba(6, 44, 32, 0.4) 100%),
        url("../images/home/banner-1-800.webp") 78% 50% / cover no-repeat;
}

.fl-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.75rem;
    font-weight: 600;
}

.fl-hero-badge .material-symbols-outlined {
    font-size: 16px;
    color: var(--home-gold);
}

.fl-hero-title {
    margin-top: 12px;
    max-width: 15em;
    font-family: var(--font-family-headline);
    font-size: clamp(1.5rem, 6.6vw, 2.875rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #ffffff;
    text-wrap: balance;
}

.fl-hero-title span {
    color: var(--home-gold);
}

.fl-hero-sub {
    margin-top: 8px;
    max-width: 34em;
    font-size: 0.875rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.86);
}

/* ==========================================================================
   2. SEARCH CARD
   ========================================================================== */
.fl-search {
    position: relative;
    z-index: 2;
    margin-top: -58px;
    padding: 12px;
    border-radius: 24px;
    background: var(--home-card);
    border: 1px solid var(--home-line);
    box-shadow: 0 22px 44px -22px rgba(13, 59, 44, 0.5), 0 2px 8px rgba(13, 59, 44, 0.06);
}

/* Trip type — segmented control */
.fl-trip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    border-radius: var(--radius-full);
    background: var(--color-surface-container-low);
}

.fl-trip-opt {
    position: relative;
    cursor: pointer;
}

.fl-trip-opt input,
.fl-class-opt input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.fl-trip-opt > span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-on-surface-variant);
    transition: background-color 0.18s var(--home-ease), color 0.18s var(--home-ease), box-shadow 0.18s var(--home-ease);
}

.fl-trip-opt .material-symbols-outlined {
    font-size: 18px;
}

.fl-trip-opt input:checked + span {
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-weight: 700;
    box-shadow: 0 6px 14px -8px var(--color-primary);
}

.fl-trip-opt input:focus-visible + span,
.fl-class-opt input:focus-visible + span {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ==========================================================================
   3. FIELDS
   ========================================================================== */
.fl-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.fl-field {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 1px;
    width: 100%;
    min-width: 0;
    min-height: 66px;
    padding: 9px 14px;
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--color-outline-variant) 75%, transparent);
    background: var(--home-card);
    color: var(--color-on-surface);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s var(--home-ease), box-shadow 0.18s var(--home-ease), background-color 0.18s var(--home-ease);
}

.fl-field:hover {
    border-color: color-mix(in srgb, var(--color-primary) 45%, var(--color-outline-variant));
}

.fl-field:focus-visible,
.fl-field:focus-within {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 16%, transparent);
}

.fl-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-on-surface-variant);
}

.fl-label .material-symbols-outlined {
    font-size: 14px;
    color: var(--home-brand);
}

.fl-sub {
    max-width: 100%;
    font-size: 0.75rem;
    line-height: 1.25;
    color: var(--color-on-surface-variant);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Route: two airports and a swap button */
.fl-route {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.fl-airport {
    padding-right: 62px;                 /* room for the swap button on phones */
}

.fl-airport-main {
    display: flex;
    align-items: baseline;
    gap: 7px;
    max-width: 100%;
    min-width: 0;
}

.fl-code {
    font-family: var(--font-family-headline);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--home-brand);
}

.fl-city {
    min-width: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fl-swap {
    position: absolute;
    top: 50%;
    right: 14px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-top: -21px;
    border-radius: 50%;
    border: 1px solid var(--home-line);
    background: var(--home-card);
    color: var(--home-brand);
    box-shadow: var(--home-shadow-sm);
    cursor: pointer;
    transition: transform 0.28s var(--home-ease), background-color 0.18s var(--home-ease), color 0.18s var(--home-ease);
}

.fl-swap:hover {
    background: var(--color-primary);
    color: var(--color-on-primary);
}

.fl-swap.is-flipped {
    transform: rotate(180deg);
}

.fl-swap .material-symbols-outlined {
    font-size: 22px;
}

/* Dates */
.fl-dates {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.fl-date {
    position: relative;
    cursor: pointer;
}

.fl-date input[type="date"] {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: var(--font-family-headline);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--color-on-surface);
    cursor: pointer;
}

[data-theme="dark"] .fl-date input[type="date"],
[data-theme="dark"] .fl-modal-search input {
    color-scheme: dark;
}

.fl-date-add {
    display: none;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--home-brand);
}

.fl-date-add .material-symbols-outlined {
    font-size: 18px;
}

/* One way: the return field becomes an invitation to add a return date */
.fl-date.is-off {
    border-style: dashed;
    background: transparent;
}

.fl-date.is-off input,
.fl-date.is-off .fl-sub {
    display: none;
}

.fl-date.is-off .fl-date-add {
    display: inline-flex;
}

/* Travellers summary */
.fl-pax {
    position: relative;
    min-width: 0;
}

.fl-pax-main {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-size: 0.9375rem;
    font-weight: 700;
}

.fl-pax-main #paxTotalDisplay {
    font-family: var(--font-family-headline);
    font-size: 1.25rem;
    font-weight: 800;
}

/* Submit */
.fl-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 56px;
    padding: 0 24px;
    border-radius: 16px;
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 14px 26px -14px var(--color-primary);
    transition: transform 0.18s var(--home-ease), background-color 0.18s var(--home-ease);
}

.fl-submit:hover {
    background: var(--color-primary-container);
    color: var(--color-on-primary-container);
    transform: translateY(-1px);
}

.fl-submit .material-symbols-outlined {
    font-size: 22px;
}

.fl-submit.is-loading {
    opacity: 0.85;
    pointer-events: none;
}

.fl-submit.is-loading .material-symbols-outlined {
    animation: fl-takeoff 1.1s var(--home-ease) infinite;
}

.fl-error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--color-error-container);
    color: var(--color-on-error-container);
    font-size: 0.8125rem;
    font-weight: 600;
}

.fl-error[hidden],
.fl-modal[hidden],
.fl-pax-panel[hidden],
.fl-sheet-backdrop[hidden] {
    display: none;
}

/* A popular route was applied: draw the eye to the search card */
.fl-search.is-pulsed {
    animation: fl-pulse 0.9s var(--home-ease);
}

/* ==========================================================================
   4. TRAVELLERS SHEET (bottom sheet on phones, popover from 768px)
   ========================================================================== */
body.fl-lock {
    overflow: hidden;
}

/* The card is its own stacking layer; lift it over the header and bottom navigation while a sheet is open */
body.fl-lock .fl-search {
    z-index: 1200;
}

.fl-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1190;
    background: rgba(0, 0, 0, 0.45);
}

.fl-pax-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 88vh;
    max-height: 88dvh;
    overflow-y: auto;
    padding: 10px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    border-radius: 24px 24px 0 0;
    background: var(--home-card);
    box-shadow: 0 -18px 40px -18px rgba(0, 0, 0, 0.45);
    animation: fl-sheet-up 0.24s var(--home-ease);
}

.fl-sheet-grip {
    width: 40px;
    height: 4px;
    margin: 0 auto 2px;
    border-radius: 4px;
    background: var(--color-outline-variant);
    flex-shrink: 0;
}

.fl-pax-title {
    font-family: var(--font-family-headline);
    font-size: 1.0625rem;
    font-weight: 800;
    color: var(--home-ink);
}

.fl-pax-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.fl-pax-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-on-surface);
}

.fl-pax-hint {
    font-size: 0.75rem;
    color: var(--color-on-surface-variant);
}

.fl-stepper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fl-stepper > span {
    min-width: 28px;
    text-align: center;
    font-family: var(--font-family-headline);
    font-size: 1.0625rem;
    font-weight: 800;
}

.fl-stepper .pax-counter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--home-line);
    background: var(--color-surface-container-low);
    color: var(--home-brand);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.fl-stepper .pax-counter-btn:hover:not(:disabled) {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-on-primary);
}

.fl-stepper .pax-counter-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.fl-pax-class {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--home-line);
}

.fl-class-opts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.fl-class-opt {
    position: relative;
    cursor: pointer;
}

.fl-class-opt > span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    border-radius: var(--radius-full);
    border: 1px solid var(--home-line);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-on-surface-variant);
    transition: background-color 0.18s var(--home-ease), color 0.18s var(--home-ease), border-color 0.18s var(--home-ease);
}

.fl-class-opt input:checked + span {
    background: var(--tint-primary);
    border-color: var(--color-primary);
    color: var(--home-brand);
    font-weight: 700;
}

.fl-pax-done {
    min-height: 50px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: var(--color-on-primary);
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
}

/* ==========================================================================
   5. AIRPORT PICKER (bottom sheet on phones, dialog from 768px)
   ========================================================================== */
.fl-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

.fl-modal-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 580px;
    height: 88vh;
    height: 88dvh;
    padding-top: 10px;
    border-radius: 24px 24px 0 0;
    background: var(--home-card);
    box-shadow: 0 -18px 40px -18px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: fl-sheet-up 0.24s var(--home-ease);
}

.fl-modal-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 12px 18px;
    font-family: var(--font-family-headline);
    font-size: 1.0625rem;
    font-weight: 800;
    color: var(--home-ink);
}

.fl-modal-head > .material-symbols-outlined {
    color: var(--home-brand);
}

.fl-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: auto;
    border-radius: 50%;
    background: var(--color-surface-container-low);
    color: var(--color-on-surface);
    cursor: pointer;
}

.fl-modal-search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    margin: 0 14px 10px;
    padding: 0 14px;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    background: var(--color-surface-container-low);
    color: var(--color-on-surface-variant);
}

.fl-modal-search:focus-within {
    border-color: var(--color-primary);
    background: var(--home-card);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 16%, transparent);
}

.fl-modal-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    font-size: 1rem;                     /* 16px: no zoom-on-focus on iOS */
    color: var(--color-on-surface);
}

.fl-modal-search input:focus-visible {
    outline: none;
}

.fl-modal-list {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 8px calc(14px + env(safe-area-inset-bottom, 0px));
}

.fl-modal-group {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 8px 10px 6px;
    background: var(--home-card);
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--home-brand);
}

.fl-airport-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    padding: 8px 10px;
    border-radius: 14px;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s var(--home-ease);
}

.fl-airport-item:hover,
.fl-airport-item:focus-visible {
    background: var(--tint-primary);
}

.fl-airport-item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.fl-airport-item-text strong {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-on-surface);
}

.fl-airport-item-text span {
    font-size: 0.78rem;
    color: var(--color-on-surface-variant);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fl-airport-item-code {
    flex-shrink: 0;
    padding: 5px 10px;
    border-radius: 10px;
    background: var(--tint-primary);
    font-family: var(--font-family-headline);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: var(--home-brand);
}

.fl-modal-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--color-on-surface-variant);
}

/* ==========================================================================
   6. BENEFITS
   ========================================================================== */
.fl-benefits {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.fl-benefit {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 12px;
    border-radius: 18px;
    background: var(--home-card);
    border: 1px solid var(--home-line);
    box-shadow: var(--home-shadow-sm);
}

.fl-benefit-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    flex-shrink: 0;
    background: color-mix(in srgb, var(--tone) 14%, var(--home-card));
    color: var(--tone);
}

.fl-benefit-icon .material-symbols-outlined {
    font-size: 21px;
}

.fl-benefit h3 {
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.25;
}

.fl-benefit p {
    margin-top: 3px;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--color-on-surface-variant);
}

/* ==========================================================================
   7. POPULAR ROUTES
   ========================================================================== */
.fl-routes-section {
    margin-top: 28px;
}

.fl-routes {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

/* Phones: compact rows — picture on the left, route and fare on the right */
.fl-route-card {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    width: 100%;
    min-height: 96px;
    overflow: hidden;
    border-radius: 18px;
    background: var(--home-card);
    border: 1px solid var(--home-line);
    box-shadow: var(--home-shadow-sm);
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s var(--home-ease), box-shadow 0.2s var(--home-ease), border-color 0.2s var(--home-ease);
}

.fl-route-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--home-shadow);
    border-color: color-mix(in srgb, var(--color-primary) 30%, var(--home-line));
}

.fl-route-media {
    position: relative;
    display: block;
    background: linear-gradient(135deg, #0d3b2c, #0b6b47);
}

.fl-route-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fl-route-badge {
    position: absolute;
    left: 6px;
    bottom: 6px;
    max-width: calc(100% - 12px);
    padding: 3px 8px;
    border-radius: var(--radius-full);
    background: rgba(6, 44, 32, 0.86);
    color: #ffffff;
    font-size: 0.625rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fl-route-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    padding: 10px 14px;
}

.fl-route-path {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
    font-family: var(--font-family-headline);
    font-size: 0.9375rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--home-ink);
}

.fl-route-path .material-symbols-outlined {
    font-size: 16px;
    color: var(--home-brand);
}

.fl-route-codes {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--color-on-surface-variant);
}

.fl-route-foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
}

.fl-route-from {
    font-size: 0.75rem;
    color: var(--color-on-surface-variant);
}

.fl-route-price {
    font-family: var(--font-family-headline);
    font-size: 1.0625rem;
    font-weight: 800;
    color: var(--home-brand);
    white-space: nowrap;
}

/* ==========================================================================
   LARGER PHONES & TABLETS (640px+)
   ========================================================================== */
@media (min-width: 640px) {
    .fl-search { padding: 16px; }

    .fl-trip {
        display: inline-grid;
        grid-template-columns: repeat(2, 150px);
    }

    .fl-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: 12px;
    }

    .fl-route {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .fl-airport { padding-right: 14px; }
    .fl-route .fl-airport:last-of-type { padding-left: 34px; }
    .fl-route .fl-airport:first-of-type { padding-right: 34px; }

    .fl-swap {
        right: auto;
        left: 50%;
        margin-left: -21px;
    }

    .fl-swap .material-symbols-outlined { transform: rotate(90deg); }

    .fl-dates { gap: 10px; }
    .fl-submit { grid-column: 1 / -1; }

    .fl-benefits { gap: 14px; margin-top: 20px; }
    .fl-benefit { padding: 16px; }

    /* Route cards become picture-on-top tiles */
    .fl-routes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .fl-route-card {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 150px auto;
        border-radius: 20px;
    }

    .fl-route-badge {
        left: auto;
        right: 10px;
        top: 10px;
        bottom: auto;
        padding: 4px 10px;
        font-size: 0.6875rem;
    }

    .fl-route-body { padding: 14px 16px 16px; }
    .fl-route-path { font-size: 1.0625rem; }
    .fl-route-price { font-size: 1.1875rem; }
}

/* ==========================================================================
   TABLET (768px+): sheets become a popover and a centred dialog
   ========================================================================== */
@media (min-width: 768px) {
    .fl-hero {
        padding: 36px 0 96px;
        border-radius: 0 0 36px 36px;
        background:
            linear-gradient(100deg, rgba(6, 44, 32, 0.96) 0%, rgba(6, 44, 32, 0.8) 40%, rgba(6, 44, 32, 0.15) 100%),
            url("../images/home/banner-1-1600.webp") 80% 50% / cover no-repeat;
    }

    .fl-hero-badge { font-size: 0.8125rem; padding: 6px 14px; }
    .fl-hero-title { margin-top: 16px; }
    .fl-hero-sub { margin-top: 12px; font-size: 1.0625rem; }

    .fl-search {
        margin-top: -68px;
        padding: 20px;
        border-radius: 28px;
    }

    .fl-field { min-height: 72px; padding: 10px 16px; }
    .fl-sheet-grip { display: none; }

    .fl-pax-panel {
        position: absolute;
        left: auto;
        right: 0;
        top: calc(100% + 8px);
        bottom: auto;
        z-index: 30;
        width: 340px;
        max-height: none;
        padding: 18px;
        border-radius: 20px;
        border: 1px solid var(--home-line);
        box-shadow: var(--home-shadow);
        animation: fl-pop 0.16s var(--home-ease);
    }

    .fl-modal {
        align-items: center;
        padding: 24px;
    }

    .fl-modal-card {
        height: auto;
        max-height: min(640px, 82vh);
        padding-top: 8px;
        border-radius: 24px;
        animation: fl-pop 0.18s var(--home-ease);
    }

    .fl-modal-list { padding-bottom: 14px; }

    .fl-benefits { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .fl-benefit h3 { font-size: 0.875rem; }

    .fl-routes-section { margin-top: 44px; }
    .fl-routes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ==========================================================================
   DESKTOP (1024px+)
   ========================================================================== */
@media (min-width: 1024px) {
    .fl-hero { padding: 52px 0 112px; }

    .fl-search { margin-top: -76px; }

    .fl-benefit {
        flex-direction: row;
        align-items: flex-start;
        gap: 12px;
        padding: 18px;
    }

    .fl-benefit-icon { width: 44px; height: 44px; }
    .fl-benefit-icon .material-symbols-outlined { font-size: 24px; }
    .fl-benefit h3 { font-size: 0.9375rem; }
    .fl-benefit p { font-size: 0.8125rem; }

    .fl-routes { gap: 20px; }
    .fl-route-card { grid-template-rows: 170px auto; }
}

/* Wide screens (1200px+): the whole search on one row */
@media (min-width: 1200px) {
    .fl-fields {
        grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.9fr) minmax(0, 1.1fr) auto;
        align-items: stretch;
        margin-top: 14px;
    }

    .fl-route,
    .fl-submit { grid-column: auto; }

    .fl-submit {
        width: auto;
        min-height: 72px;
        padding: 0 26px;
        border-radius: 18px;
    }
}

@media (min-width: 1280px) {
    .fl-code { font-size: 1.375rem; }
    .fl-date input[type="date"] { font-size: 1rem; }
    .fl-route-card { grid-template-rows: 190px auto; }
}

/* Very narrow phones */
@media (max-width: 359px) {
    .fl-search { padding: 10px; }
    .fl-field { padding: 9px 11px; }
    .fl-airport { padding-right: 58px; }
    .fl-date input[type="date"] { font-size: 0.8125rem; }
    .fl-benefit p { display: none; }
    .fl-hero { padding-top: 16px; }
    .fl-hero-sub { display: none; }
    .fl-route-card { grid-template-columns: 88px minmax(0, 1fr); }
}

/* ==========================================================================
   8. MOTION
   ========================================================================== */
@keyframes fl-sheet-up {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

@keyframes fl-pop {
    from { transform: translateY(-6px) scale(0.98); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

@keyframes fl-pulse {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-primary) 45%, transparent), 0 22px 44px -22px rgba(13, 59, 44, 0.5); }
    100% { box-shadow: 0 0 0 16px transparent, 0 22px 44px -22px rgba(13, 59, 44, 0.5); }
}

@keyframes fl-takeoff {
    0%   { transform: translate(-4px, 3px); opacity: 0.4; }
    60%  { transform: translate(4px, -3px); opacity: 1; }
    100% { transform: translate(8px, -6px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .fl-page *,
    .fl-modal *,
    .fl-modal-card,
    .fl-pax-panel {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
