:root {
    --flight-primary: #175cd3;
    --flight-primary-dark: #0d47a1;
    --flight-secondary: #6b4eff;
    --flight-text: #172033;
    --flight-muted: #667085;
    --flight-border: #dfe4ea;
    --flight-soft-bg: #f5f7fb;
    --flight-white: #ffffff;
    --flight-success: #079455;
    --flight-danger: #d92d20;
}

* {
    box-sizing: border-box;
}

.flight-page {
    background: #f7f9fc;
    min-height: 100vh;
}

.flight-hero {
    position: relative;
    min-height: 620px;
    padding: 70px 0 100px;
    overflow: visible;
    background:
        radial-gradient(
            circle at 10% 10%,
            rgba(98, 126, 234, 0.22),
            transparent 28%
        ),
        radial-gradient(
            circle at 90% 20%,
            rgba(117, 81, 255, 0.18),
            transparent 30%
        ),
        linear-gradient(
            180deg,
            #eef4ff 0%,
            #f8faff 65%,
            #f7f9fc 100%
        );
}

.flight-hero::before {
    content: "";
    position: absolute;
    top: 40px;
    right: 6%;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    border: 1px solid rgba(23, 92, 211, 0.08);
    box-shadow:
        0 0 0 40px rgba(23, 92, 211, 0.025),
        0 0 0 80px rgba(23, 92, 211, 0.02);
    pointer-events: none;
}

.flight-hero .container {
    position: relative;
    z-index: 2;
}

.flight-heading {
    max-width: 760px;
    margin-bottom: 30px;
}

.flight-heading-tag {
    display: inline-flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 7px 13px;
    border: 1px solid rgba(23, 92, 211, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--flight-primary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.flight-heading h1 {
    margin: 0 0 10px;
    color: var(--flight-text);
    font-size: clamp(30px, 4vw, 48px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.flight-heading p {
    max-width: 650px;
    margin: 0;
    color: var(--flight-muted);
    font-size: 17px;
    line-height: 1.65;
}

/* Travel tabs */

.travel-service-tabs {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.travel-service-tab {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 190px;
    padding: 12px 17px;
    border: 1px solid rgba(23, 92, 211, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.68);
    color: var(--flight-text);
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
    backdrop-filter: blur(10px);
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.travel-service-tab:hover {
    color: var(--flight-primary);
    text-decoration: none;
    border-color: rgba(23, 92, 211, 0.3);
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
}

.travel-service-tab.active {
    border-color: var(--flight-primary);
    background: linear-gradient(
        135deg,
        var(--flight-primary),
        var(--flight-secondary)
    );
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(23, 92, 211, 0.26);
}

.service-tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #edf4ff;
    color: var(--flight-primary);
}

.active .service-tab-icon {
    background: rgba(255, 255, 255, 0.17);
    color: #ffffff;
}

.service-tab-icon svg {
    width: 23px;
    height: 23px;
    fill: currentColor;
}

.travel-service-tab > span:last-child {
    display: flex;
    flex-direction: column;
}

.travel-service-tab strong {
    font-size: 15px;
    line-height: 1.35;
}

.travel-service-tab small {
    margin-top: 2px;
    color: var(--flight-muted);
    font-size: 11px;
}

.travel-service-tab.active small {
    color: rgba(255, 255, 255, 0.76);
}

/* Search card */

.flight-search-card {
    position: relative;
    padding: 28px;
    border: 1px solid rgba(16, 24, 40, 0.08);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow:
        0 30px 70px rgba(16, 24, 40, 0.12),
        0 3px 12px rgba(16, 24, 40, 0.04);
    backdrop-filter: blur(12px);
}

.flight-search-form {
    width: 100%;
}

.search-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 23px;
}

.trip-type {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin: 0;
}

.trip-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 9px 13px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: #475467;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.trip-option:hover {
    background: #f5f8ff;
    color: var(--flight-primary);
}

.trip-option:has(input:checked) {
    border-color: rgba(23, 92, 211, 0.17);
    background: #edf4ff;
    color: var(--flight-primary);
}

.trip-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.trip-radio {
    position: relative;
    width: 17px;
    height: 17px;
    border: 1.5px solid #98a2b3;
    border-radius: 50%;
    background: #ffffff;
}

.trip-option input:checked + .trip-radio {
    border: 5px solid var(--flight-primary);
}

.trip-option-disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.trip-option small {
    padding: 2px 6px;
    border-radius: 999px;
    background: #f2f4f7;
    font-size: 9px;
    font-weight: 700;
}

.secure-booking {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--flight-success);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.secure-booking svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Search grid */

.flight-search-grid {
    position: relative;
    display: grid;
    grid-template-columns:
        minmax(200px, 1.45fr)
        38px
        minmax(200px, 1.45fr)
        minmax(165px, 0.9fr)
        minmax(165px, 0.9fr);
    align-items: end;
    gap: 10px;
}

.search-field {
    position: relative;
    min-width: 0;
}

.search-field > label {
    display: block;
    margin: 0 0 8px;
    color: #475467;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.field-input-wrap,
.traveller-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 64px;
    border: 1px solid var(--flight-border);
    border-radius: 14px;
    background: #ffffff;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.field-input-wrap:focus-within,
.traveller-box:hover,
.traveller-box:focus {
    border-color: rgba(23, 92, 211, 0.72);
    box-shadow: 0 0 0 4px rgba(23, 92, 211, 0.08);
    outline: none;
}

.field-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    color: var(--flight-primary);
}

.field-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.field-input-wrap input {
    flex: 1;
    min-width: 0;
    width: 100%;
    height: 100%;
    padding: 0 13px 0 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--flight-text);
    font-size: 15px;
    font-weight: 600;
}

.field-input-wrap input::placeholder {
    color: #98a2b3;
    font-weight: 500;
}

.field-input-wrap input[type="date"] {
    cursor: pointer;
}

.swap-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: end;
    width: 38px;
    height: 38px;
    margin-bottom: 13px;
    padding: 0;
    border: 1px solid rgba(23, 92, 211, 0.2);
    border-radius: 50%;
    background: #ffffff;
    color: var(--flight-primary);
    box-shadow: 0 6px 16px rgba(23, 92, 211, 0.12);
    cursor: pointer;
    transition:
        transform 0.25s ease,
        background 0.2s ease,
        color 0.2s ease;
}

.swap-btn:hover {
    background: var(--flight-primary);
    color: #ffffff;
    transform: rotate(180deg);
}

.swap-btn svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

/* Bottom area */

.flight-search-bottom {
    display: grid;
    grid-template-columns:
        minmax(230px, 1.1fr)
        minmax(370px, 1.8fr)
        minmax(190px, 0.85fr);
    align-items: end;
    gap: 14px;
    margin-top: 20px;
}

.traveller-field {
    position: relative;
}

.traveller-box {
    padding-right: 14px;
    cursor: pointer;
}

.traveller-box #travellerSummary {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--flight-text);
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.traveller-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667085;
}

.traveller-arrow svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.traveller-box.open .traveller-arrow svg {
    transform: rotate(180deg);
}

/* Traveller popup */

.traveller-popup {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 9999;
    display: none;
    width: 360px;
    max-width: calc(100vw - 32px);
    padding: 20px;
    border: 1px solid #eaecf0;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(16, 24, 40, 0.18);
}

.traveller-popup::before {
    content: "";
    position: absolute;
    top: -7px;
    left: 28px;
    width: 13px;
    height: 13px;
    border-top: 1px solid #eaecf0;
    border-left: 1px solid #eaecf0;
    background: #ffffff;
    transform: rotate(45deg);
}

.traveller-popup-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 8px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f2f5;
}

.traveller-popup-header > div {
    display: flex;
    flex-direction: column;
}

.traveller-popup-header strong {
    color: var(--flight-text);
    font-size: 17px;
}

.traveller-popup-header span {
    margin-top: 2px;
    color: var(--flight-muted);
    font-size: 12px;
}

.traveller-close {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f2f4f7;
    color: #475467;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.traveller-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin: 0;
    padding: 14px 0;
    border-bottom: 1px solid #f2f4f7;
}

.traveller-label {
    display: flex;
    flex-direction: column;
}

.traveller-label strong {
    color: var(--flight-text);
    font-size: 14px;
}

.traveller-label span {
    margin-top: 3px;
    color: var(--flight-muted);
    font-size: 11px;
}

.counter-control {
    display: flex;
    align-items: center;
    gap: 11px;
}

.counter-control button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 31px;
    height: 31px;
    padding: 0;
    border: 1px solid #d0d5dd;
    border-radius: 9px;
    background: #ffffff;
    color: var(--flight-primary);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: 0.2s ease;
}

.counter-control button:hover {
    border-color: var(--flight-primary);
    background: #edf4ff;
}

.counter-control > span {
    min-width: 18px;
    color: var(--flight-text);
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}

.cabin-class-field {
    margin-top: 16px;
}

.cabin-class-field label {
    display: block;
    margin-bottom: 7px;
    color: #475467;
    font-size: 12px;
    font-weight: 700;
}

.cabin-class-field select {
    width: 100%;
    height: 46px;
    padding: 0 12px;
    border: 1px solid var(--flight-border);
    border-radius: 10px;
    outline: none;
    background: #ffffff;
    color: var(--flight-text);
    font-size: 14px;
}

.cabin-class-field select:focus {
    border-color: var(--flight-primary);
}

.traveller-done-btn {
    width: 100%;
    height: 45px;
    margin-top: 16px;
    border: 0;
    border-radius: 10px;
    background: var(--flight-primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

/* Fare selection */

.fare-options-title {
    display: block;
    margin-bottom: 8px;
    color: #475467;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.fare-option-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.fare-option {
    display: flex;
    min-height: 64px;
    padding: 11px 12px;
    border: 1px solid var(--flight-border);
    border-radius: 12px;
    background: #ffffff;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    cursor: pointer;
    transition: 0.2s ease;
}

.fare-option:hover {
    border-color: rgba(23, 92, 211, 0.48);
    background: #f9fbff;
}

.fare-option.active {
    border-color: var(--flight-primary);
    background: #edf4ff;
    box-shadow: 0 0 0 2px rgba(23, 92, 211, 0.06);
}

.fare-option strong {
    color: var(--flight-text);
    font-size: 12px;
    line-height: 1.3;
}

.fare-option small {
    margin-top: 4px;
    color: var(--flight-success);
    font-size: 10px;
    line-height: 1.25;
}

/* Search button */

.search-button-wrap {
    min-width: 0;
}

.btn-search {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    height: 64px;
    padding: 0 20px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(
        135deg,
        var(--flight-primary),
        var(--flight-secondary)
    );
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 12px 26px rgba(23, 92, 211, 0.25);
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.btn-search:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(23, 92, 211, 0.33);
}

.btn-search svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Airport autocomplete */

.airport-search {
    position: relative;
}

.airport-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    z-index: 9998;
    display: none;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #eaecf0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 20px 45px rgba(16, 24, 40, 0.16);
}

.airport-item {
    padding: 13px 15px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background 0.15s ease;
}

.airport-item:last-child {
    border-bottom: 0;
}

.airport-item:hover {
    background: #f5f8ff;
}

.airport-city {
    color: var(--flight-text);
    font-size: 14px;
    font-weight: 700;
}

.airport-name,
.airport-country {
    margin-top: 3px;
    color: var(--flight-muted);
    font-size: 11px;
    line-height: 1.4;
}

.airport-empty,
.airport-loading,
.airport-error {
    padding: 17px 15px;
    color: var(--flight-muted);
    font-size: 13px;
    text-align: center;
}

/* Responsive */

@media (max-width: 1199px) {
    .flight-search-grid {
        grid-template-columns:
            minmax(200px, 1fr)
            38px
            minmax(200px, 1fr)
            minmax(160px, 0.75fr);
    }

    .return-box {
        grid-column: 4 / 5;
    }

    .flight-search-bottom {
        grid-template-columns: 1fr 1.7fr;
    }

    .search-button-wrap {
        grid-column: 1 / -1;
    }
}

@media (max-width: 991px) {
    .flight-hero {
        padding: 55px 0 80px;
    }

    .flight-search-grid {
        grid-template-columns: 1fr 44px 1fr;
    }

    .date-card {
        grid-column: auto;
    }

    .return-box {
        grid-column: auto;
    }

    .flight-search-grid .date-card:first-of-type {
        grid-column: 1 / 2;
    }

    .flight-search-bottom {
        grid-template-columns: 1fr;
    }

    .search-button-wrap {
        grid-column: auto;
    }
}

@media (max-width: 767px) {
    .flight-hero {
        padding: 35px 0 60px;
    }

    .flight-heading {
        margin-bottom: 23px;
    }

    .flight-heading h1 {
        font-size: 31px;
    }

    .flight-heading p {
        font-size: 15px;
    }

    .travel-service-tabs {
        width: 100%;
        gap: 8px;
    }

    .travel-service-tab {
        flex: 1;
        min-width: 0;
        padding: 10px;
        border-radius: 13px;
    }

    .service-tab-icon {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
    }

    .travel-service-tab small {
        display: none;
    }

    .flight-search-card {
        padding: 19px;
        border-radius: 19px;
    }

    .search-card-top {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .secure-booking {
        display: none;
    }

    .trip-type {
        width: 100%;
        gap: 4px;
    }

    .trip-option {
        padding: 8px 9px;
        font-size: 12px;
    }

    .trip-option small {
        display: none;
    }

    .flight-search-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .swap-btn {
        position: absolute;
        top: 80px;
        right: 15px;
        z-index: 5;
        width: 36px;
        height: 36px;
        margin: 0;
        transform: rotate(90deg);
    }

    .swap-btn:hover {
        transform: rotate(270deg);
    }

    .flight-search-grid .date-card:first-of-type,
    .return-box {
        grid-column: auto;
    }

    .flight-search-bottom {
        gap: 14px;
    }

    .fare-option-list {
        grid-template-columns: 1fr;
    }

    .fare-option {
        min-height: auto;
    }

    .traveller-popup {
        position: fixed;
        right: 16px;
        bottom: 16px;
        left: 16px;
        top: auto;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
    }

    .traveller-popup::before {
        display: none;
    }
}

@media (max-width: 420px) {
    .travel-service-tab {
        gap: 7px;
    }

    .travel-service-tab strong {
        font-size: 13px;
    }

    .service-tab-icon {
        flex-basis: 32px;
        width: 32px;
        height: 32px;
    }

    .trip-option {
        flex: 1;
        justify-content: center;
    }

    .trip-option-disabled {
        display: none;
    }
}