:root {
    --ink: #17202a;
    --muted: #667085;
    --line: #d7dee8;
    --paper: #ffffff;
    --surface: #f4f7fb;
    --brand: #f2d22e;
    --brand-ink: #302900;
    --green: #1f9d63;
    --blue: #2374ab;
    --danger: #c2413a;
    --shadow: 0 16px 38px rgba(23, 32, 42, .12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: #f7d932;
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid rgba(23, 32, 42, .08);
    backdrop-filter: blur(10px);
}

.topbar__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    width: min(1180px, calc(100% - 32px));
    min-height: 76px;
    margin: 0 auto;
}

.brand img {
    width: 142px;
    height: auto;
}

.nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.nav a,
.panel-nav a {
    padding: 10px 12px;
    border-radius: 8px;
    color: #26313d;
    font-weight: 700;
    font-size: 14px;
}

.nav a.active,
.nav a:hover,
.panel-nav a.active,
.panel-nav a:hover {
    background: var(--brand);
    color: var(--brand-ink);
}

.account {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
}

.account form {
    margin: 0;
}

.account button {
    border: 0;
    background: transparent;
    color: var(--blue);
    cursor: pointer;
    font-weight: 700;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border: 1px solid var(--green);
    border-radius: 8px;
    background: var(--green);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    line-height: 1.1;
}

.button:hover {
    filter: brightness(.96);
}

.button--ghost {
    border-color: var(--line);
    background: #fff;
    color: var(--ink);
}

.button--small {
    min-height: 38px;
    padding-inline: 14px;
    font-size: 14px;
}

.button--full {
    width: 100%;
}

.hero,
.page-hero {
    position: relative;
    min-height: 360px;
    overflow: hidden;
    color: #fff;
}

.page-hero {
    min-height: 220px;
}

.hero img,
.page-hero img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero::after,
.page-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 22, .48);
}

.hero__content,
.page-hero > div {
    position: relative;
    z-index: 1;
    width: min(920px, calc(100% - 32px));
    margin: 0 auto;
    padding-top: 82px;
}

.hero h1,
.page-hero h1,
.auth-copy h1,
.section__title h1,
.panel-heading h1 {
    margin: 0;
    font-size: clamp(34px, 6vw, 68px);
    line-height: .98;
}

.page-hero h1,
.auth-copy h1,
.section__title h1,
.panel-heading h1 {
    font-size: clamp(30px, 4vw, 48px);
}

.hero p,
.page-hero p {
    max-width: 640px;
    font-size: 18px;
    line-height: 1.55;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.hero .eyebrow,
.page-hero .eyebrow {
    color: var(--brand);
}

.search-band {
    background: var(--brand);
}

.search-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 160px auto;
    gap: 12px;
    width: min(1040px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 10px 12px;
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(35, 116, 171, .15);
}

.section {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 56px 0 72px;
}

.section__title {
    max-width: 760px;
    margin: 0 auto 28px;
    text-align: center;
}

.section__title--left {
    margin-inline: 0;
    text-align: left;
}

.section__title h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
}

.section__title p {
    color: #465260;
    line-height: 1.55;
}

.trip-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.trip-card,
.empty-state,
.booking-panel,
.reserve-panel,
.form-panel,
.wide-form,
.metric-card,
.table-wrap {
    border: 1px solid rgba(23, 32, 42, .1);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.trip-card {
    display: grid;
    grid-template-rows: 218px 1fr;
    overflow: hidden;
}

.trip-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trip-card__body {
    display: grid;
    gap: 18px;
    padding: 18px;
}

.trip-card__date,
.seat-count,
.price-note {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.trip-card h3 {
    margin: 4px 0 8px;
    font-size: 21px;
}

.trip-card p {
    line-height: 1.5;
}

.trip-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.trip-card__footer span,
.price {
    color: var(--green);
    font-size: 28px;
    font-weight: 900;
}

.empty-state {
    max-width: 620px;
    margin: 0 auto;
    padding: 28px;
    text-align: center;
}

.detail-layout,
.seat-page,
.auth-layout,
.form-page,
.panel {
    display: grid;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 46px 0 72px;
}

.detail-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
}

.gallery {
    display: grid;
    gap: 12px;
}

.gallery__main {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    object-fit: cover;
}

.gallery__thumbs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.gallery__thumbs img {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    object-fit: cover;
}

.booking-panel,
.reserve-panel,
.form-panel {
    padding: 24px;
}

.booking-panel dl {
    display: grid;
    gap: 12px;
    margin: 18px 0;
}

.booking-panel dl div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.booking-panel dt {
    color: var(--muted);
    font-weight: 700;
}

.booking-panel dd {
    margin: 0;
    text-align: right;
    font-weight: 800;
}

.description {
    grid-column: 1 / -1;
    padding: 24px 0;
    font-size: 17px;
    line-height: 1.7;
}

.seat-page {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
    align-items: start;
}

.seat-shell {
    overflow-x: auto;
    padding: 20px;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.seat-map {
    min-width: 720px;
}

.bus-body {
    position: relative;
    width: 690px;
    height: 230px;
    border: 3px solid #9aa8b7;
    border-left-width: 52px;
    border-radius: 46px 18px 18px 46px;
    background: linear-gradient(90deg, #eaf0f7 0 18%, #f8fafc 18% 100%);
}

.bus-body::before {
    content: "";
    position: absolute;
    left: -38px;
    top: 76px;
    width: 22px;
    height: 68px;
    border-radius: 12px;
    background: #4e657b;
}

.seat {
    position: absolute;
    width: 38px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 900;
}

.seat--free {
    background: #6fbf30;
}

.seat--busy {
    background: repeating-linear-gradient(45deg, #8592a2, #8592a2 5px, #6b7280 5px, #6b7280 10px);
    cursor: not-allowed;
}

.seat.is-selected {
    background: var(--blue);
}

.x-1 { left: 28px; }
.x-2 { left: 76px; }
.x-3 { left: 124px; }
.x-4 { left: 172px; }
.x-5 { left: 220px; }
.x-6 { left: 268px; }
.x-7 { left: 316px; }
.x-8 { left: 364px; }
.x-9 { left: 412px; }
.x-10 { left: 460px; }
.x-11 { left: 508px; }
.x-12 { left: 556px; }
.x-13 { left: 604px; }
.y-0 { bottom: 22px; }
.y-1 { bottom: 64px; }
.y-3 { top: 64px; }
.y-4 { top: 22px; }

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.legend i {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend__free { background: #6fbf30; }
.legend__selected { background: var(--blue); }
.legend__busy { background: #7b8794; }

.selected-seats {
    min-height: 44px;
    margin: 16px 0;
    padding: 12px;
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 800;
}

.auth-layout {
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 36px;
    align-items: center;
}

.auth-copy p,
.form-page p {
    color: #465260;
    line-height: 1.6;
}

.form-panel {
    display: grid;
    gap: 16px;
}

.form-panel__hint {
    margin: 0;
    color: var(--muted);
    text-align: center;
}

.form-panel__hint a {
    color: var(--blue);
    font-weight: 800;
}

.wide-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 24px;
}

.span-2 {
    grid-column: span 2;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.panel {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.panel-nav {
    display: grid;
    gap: 8px;
    position: sticky;
    top: 96px;
    padding: 14px;
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.panel-content {
    display: grid;
    gap: 18px;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.metric-card {
    padding: 20px;
}

.metric-card span {
    color: var(--muted);
    font-weight: 800;
}

.metric-card strong {
    display: block;
    margin-top: 10px;
    color: var(--blue);
    font-size: 38px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

td a {
    color: var(--blue);
    font-weight: 800;
}

.flash-wrap {
    position: fixed;
    right: 16px;
    top: 92px;
    z-index: 30;
    display: grid;
    gap: 8px;
    width: min(360px, calc(100% - 32px));
}

.flash {
    padding: 13px 15px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    color: #fff;
    font-weight: 800;
}

.flash--success {
    background: var(--green);
}

.flash--danger {
    background: var(--danger);
}

.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px max(16px, calc((100vw - 1180px) / 2));
    background: #17202a;
    color: #fff;
}

.footer div {
    display: grid;
    gap: 4px;
}

.footer span {
    color: #cbd5e1;
}

@media (max-width: 920px) {
    .topbar__inner,
    .nav,
    .account {
        flex-wrap: wrap;
    }

    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-left: 0;
        padding-bottom: 12px;
    }

    .search-form,
    .trip-grid,
    .detail-layout,
    .seat-page,
    .auth-layout,
    .panel,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .wide-form {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }

    .panel-nav {
        position: static;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .hero,
    .page-hero {
        min-height: 300px;
    }

    .page-hero {
        min-height: 180px;
    }

    .hero__content,
    .page-hero > div {
        padding-top: 52px;
    }

    .trip-card {
        grid-template-rows: 190px 1fr;
    }

    .trip-card__footer,
    .panel-heading,
    .footer {
        align-items: stretch;
        flex-direction: column;
    }

    .gallery__thumbs,
    .panel-nav {
        grid-template-columns: 1fr;
    }
}
