:root {
    --ink: #172033;
    --muted: #6b7280;
    --line: #dbe3ee;
    --panel: #ffffff;
    --bg: #f6f8fb;
    --brand: #d8463f;
    --teal: #0f766e;
    --gold: #f4b24d;
    --blue: #2563eb;
    --shadow: 0 20px 55px rgba(23, 32, 51, .14);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

.nav {
    height: 70px;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 max(24px, calc((100vw - 1180px) / 2));
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav strong {
    color: var(--brand);
    font-size: 28px;
}

.primary-nav {
    display: flex;
    gap: 18px;
    flex: 1;
}

.nav a {
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.auth-nav {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.auth-nav a {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 16px;
    background: #fff;
}

.auth-nav a:last-child {
    border-color: var(--brand);
    color: #fff;
    background: var(--brand);
    box-shadow: 0 10px 24px rgba(216, 70, 63, .22);
}

.nav span {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 56px;
}

.hero {
    min-height: 390px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
    gap: 56px;
    align-items: center;
    margin: 0 calc(50% - 50vw) 110px;
    padding: 64px max(24px, calc((100vw - 1180px) / 2)) 0;
    background:
        linear-gradient(90deg, rgba(16, 27, 43, .86), rgba(16, 27, 43, .24)),
        linear-gradient(135deg, #123047 0%, #2e6f72 38%, #e4b85a 76%, #cf5c42 100%);
    position: relative;
    overflow: visible;
}

.hero-copy {
    width: min(620px, 100%);
    padding-bottom: 116px;
    color: #fff;
    position: relative;
    z-index: 1;
}

.hero-copy p {
    margin: 0 0 12px;
    color: #fde68a;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.hero-copy h1 {
    margin: 0 0 14px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.02;
}

.hero-copy span {
    color: rgba(255,255,255,.88);
    font-size: 17px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}

.hero-actions a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0 18px;
    color: #fff;
    background: var(--brand);
    font-weight: 900;
    text-decoration: none;
}

.hero-actions a:last-child {
    color: var(--ink);
    background: #fff;
}

.hero-visual {
    align-self: end;
    justify-self: end;
    width: min(440px, 100%);
    margin-bottom: 118px;
    position: relative;
    z-index: 1;
}

.route-pill {
    width: max-content;
    margin-left: auto;
    margin-bottom: 12px;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 999px;
    padding: 8px 14px;
    color: #fff;
    background: rgba(255,255,255,.14);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.bus-illustration {
    height: 176px;
    border-radius: 28px 48px 24px 24px;
    background:
        linear-gradient(90deg, transparent 18px, rgba(37,99,235,.14) 18px 96px, transparent 96px) 34px 48px / 110px 52px repeat-x,
        linear-gradient(180deg, #ffffff, #dbe8f4);
    box-shadow: 0 30px 55px rgba(0,0,0,.24);
    position: relative;
}

.bus-illustration span {
    position: absolute;
    top: 48px;
    width: 74px;
    height: 48px;
    border-radius: 12px;
    background: #b8d6eb;
}

.bus-illustration span:first-child { left: 42px; }
.bus-illustration span:nth-child(2) { left: 132px; }

.bus-illustration i {
    position: absolute;
    bottom: -18px;
    width: 46px;
    height: 46px;
    border: 8px solid #263243;
    border-radius: 50%;
    background: #fff;
}

.bus-illustration i:nth-of-type(1) { left: 78px; }
.bus-illustration i:nth-of-type(2) { right: 78px; }

.search-card {
    position: absolute;
    left: 50%;
    bottom: -72px;
    transform: translateX(-50%);
    width: min(1180px, calc(100vw - 32px));
    display: grid;
    grid-template-columns: 1fr 1.15fr 1.15fr .9fr .85fr .9fr .8fr auto;
    gap: 0;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    z-index: 2;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

input, select {
    min-height: 48px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--ink);
    background: #f9fafb;
}

button {
    min-height: 48px;
    border: 0;
    border-radius: 999px;
    padding: 0 22px;
    color: #fff;
    background: var(--brand);
    font-weight: 900;
    cursor: pointer;
}

.notice {
    margin: 0 0 18px;
    padding: 12px 16px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fff1f2;
    color: #9f1239;
    font-weight: 800;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

.quick-grid article, .panel, .feature-strip article, .account-band {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(23, 32, 51, .07);
}

.quick-grid article {
    padding: 18px;
    border-top: 4px solid var(--teal);
}

.quick-grid article:nth-child(2) { border-top-color: var(--gold); }
.quick-grid article:nth-child(3) { border-top-color: var(--blue); }
.quick-grid article:nth-child(4) { border-top-color: var(--brand); }

.quick-grid span, .quick-grid small, .panel-head span, .bus-card span, .bus-card small, .ticket span, .ticket small, .feature-strip span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.quick-grid strong {
    display: block;
    margin: 8px 0;
    font-size: 26px;
}

.account-band {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) 260px 260px;
    gap: 16px;
    align-items: stretch;
    padding: 20px;
    margin-bottom: 18px;
}

.account-band > div:first-child span {
    color: var(--teal);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.account-band h2 {
    margin: 8px 0;
    font-size: 24px;
}

.account-band p {
    margin: 0;
    color: var(--muted);
}

.auth-form, .signed-in {
    display: grid;
    gap: 10px;
    align-content: start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcff;
}

.account-action {
    display: grid;
    gap: 10px;
    align-content: start;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcff;
}

.account-action strong {
    font-size: 17px;
}

.account-action span {
    color: var(--muted);
    font-size: 13px;
}

.account-action a, .auth-form a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0 16px;
    color: #fff;
    background: var(--brand);
    font-weight: 900;
    text-decoration: none;
}

.auth-page {
    min-height: calc(100vh - 70px);
    display: grid;
    align-items: center;
    margin-bottom: 0;
    padding: 42px 0;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 28px;
    align-items: stretch;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(18,48,71,.96), rgba(46,111,114,.84) 48%, rgba(207,92,66,.8)),
        #123047;
    box-shadow: var(--shadow);
}

.auth-copy {
    display: grid;
    align-content: center;
    color: #fff;
}

.auth-copy span {
    color: #fde68a;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.auth-copy h1 {
    max-width: 520px;
    margin: 12px 0;
    font-size: 44px;
    line-height: 1.05;
}

.auth-copy p {
    max-width: 560px;
    margin: 0;
    color: rgba(255,255,255,.84);
    font-size: 17px;
}

.auth-form-large {
    min-height: 420px;
    padding: 20px;
    background: #fff;
}

.auth-form-large strong {
    font-size: 24px;
}

.auth-form-large a {
    color: var(--brand);
    background: #fff;
    border: 1px solid #fecaca;
}

.form-notice {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    color: #9f1239;
    background: #fff1f2;
    font-size: 13px;
    font-weight: 800;
}

.auth-form strong, .signed-in strong {
    font-size: 16px;
}

.signed-in span, .signed-in small {
    color: var(--muted);
    font-size: 12px;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    margin-bottom: 18px;
}

.content-grid .wide {
    min-width: 0;
}

.panel {
    padding: 20px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.panel h2 {
    margin: 0;
}

.bus-list, .ticket-list {
    display: grid;
    gap: 12px;
}

.bus-card {
    display: grid;
    grid-template-columns: 1.4fr .7fr .7fr .75fr auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfcff;
}

.bus-card small {
    grid-column: 1 / -1;
}

.map-card {
    min-height: 210px;
    padding: 18px;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .9), rgba(37, 99, 235, .78)),
        #0f766e;
    color: #fff;
}

.map-card p, .map-card small {
    color: rgba(255,255,255,.86);
}

.route-line {
    height: 8px;
    margin: 40px 0 44px;
    border-radius: 999px;
    background: rgba(255,255,255,.34);
}

.route-line span {
    display: block;
    width: 62%;
    height: 100%;
    border-radius: 999px;
    background: #fde68a;
}

.sos {
    width: 100%;
    margin-top: 14px;
    background: #b42318;
}

.seat-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.seat {
    display: grid;
    place-items: center;
    min-height: 38px;
    border-radius: 9px;
    background: #e8f5f3;
    color: #075e57;
    font-weight: 800;
}

.seat.booked {
    background: #fee2e2;
    color: #991b1b;
}

.ticket {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.qr {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border-radius: 10px;
    background:
        linear-gradient(90deg, #111 8px, transparent 8px) 0 0 / 16px 16px,
        linear-gradient(#111 8px, transparent 8px) 0 0 / 16px 16px,
        #fff;
    color: var(--brand);
    font-weight: 900;
}

.feature-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.feature-strip article {
    padding: 18px;
}

.feature-strip strong {
    display: block;
    margin-bottom: 8px;
}

@media (max-width: 1050px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .hero-visual {
        display: none;
    }

    .search-card, .content-grid, .account-band, .auth-shell {
        grid-template-columns: 1fr 1fr;
    }

    .search-card button {
        grid-column: span 2;
    }

    .account-band > div:first-child {
        grid-column: span 2;
    }

    .quick-grid, .feature-strip {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 720px) {
    .nav { height: auto; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
    .primary-nav { order: 3; flex-basis: 100%; }
    .auth-nav { margin-left: auto; }
    .nav span { flex-basis: 100%; }
    .hero { margin-bottom: 250px; }
    .hero-copy { padding-bottom: 250px; }
    .search-card, .content-grid, .quick-grid, .feature-strip, .bus-card, .ticket, .account-band, .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-copy h1 {
        font-size: 32px;
    }

    .search-card button, .account-band > div:first-child {
        grid-column: auto;
    }
}
