:root {
    --gold: #f6c343;
    --gold-dark: #d89d15;
    --navy: #0f172a;
    --navy-soft: #1e293b;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #ffffff;
    --soft-bg: #f8fafc;
    --danger: #b42318;
    --success: #087443;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
    --font-body: "Inter", Arial, Helvetica, sans-serif;
    --font-heading: "Manrope", "Inter", Arial, Helvetica, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    background: var(--bg);
    color: var(--navy);
    font-family: var(--font-body);
    line-height: 1.5;
}

main {
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
}

img,
svg,
video {
    max-width: 100%;
}

.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: #fff;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-inner {
    display: grid;
    justify-items: center;
    gap: 18px;
}

.preloader-inner img {
    display: block;
    width: min(260px, 70vw);
    height: auto;
    object-fit: contain;
    animation: preloadPulse 1.2s ease-in-out infinite;
}

.preloader-inner span {
    position: relative;
    display: block;
    width: min(220px, 58vw);
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: #eef2f7;
}

.preloader-inner span::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 45%;
    border-radius: inherit;
    background: var(--gold);
    animation: preloadBar 1.1s ease-in-out infinite;
}

@keyframes preloadPulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.9;
    }

    50% {
        transform: scale(1.035);
        opacity: 1;
    }
}

@keyframes preloadBar {
    0% {
        transform: translateX(-110%);
    }

    100% {
        transform: translateX(240%);
    }
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    align-items: center;
    gap: 20px;
    min-height: 78px;
    padding: 10px clamp(18px, 5vw, 72px);
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.brand {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    font-weight: 800;
    color: var(--navy);
}

.brand-logo {
    display: block;
    width: clamp(150px, 22vw, 220px);
    max-width: 100%;
    height: 56px;
    max-height: 56px;
    border-radius: 8px;
    object-fit: contain;
    object-position: left center;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.site-nav > a {
    padding: 8px 10px;
    border-radius: 8px;
}

.site-nav > a:hover {
    background: var(--soft-bg);
    color: var(--navy);
}

.site-nav > a.is-active {
    background: rgba(246, 195, 67, 0.22);
    color: var(--navy);
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.header-logout-form {
    margin: 0;
}

.mobile-only-auth {
    display: none !important;
}

.login-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 126px;
    min-height: 38px;
    border-radius: 8px;
    background: rgba(8, 116, 67, 0.1);
    color: var(--success);
    font-weight: 800;
    padding: 8px 12px;
    white-space: nowrap;
}

.is-admin-area .site-nav {
    min-height: 44px;
}

.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.mobile-menu-toggle span {
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: var(--navy);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
    gap: clamp(28px, 5vw, 64px);
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: calc(100vh - 72px);
    padding: clamp(34px, 6vw, 80px) clamp(18px, 5vw, 72px);
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.6)),
        url("/assets/images/bg-1.png") center / cover no-repeat;
}

.hero-content {
    min-width: 0;
    max-width: 720px;
    overflow-wrap: anywhere;
}

.eyebrow,
.badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    background: rgba(246, 195, 67, 0.2);
    color: #8a5a00;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.eyebrow {
    padding: 8px 12px;
    margin: 0 0 18px;
}

.badge {
    padding: 6px 10px;
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 18px;
    color: var(--navy);
    font-size: clamp(40px, 7vw, 78px);
    line-height: 1.02;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.hero-copy {
    max-width: 560px;
    margin-bottom: 0;
    color: var(--navy-soft);
    font-size: 20px;
    overflow-wrap: anywhere;
}

.hero-panel,
.admin-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.hero-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: clamp(18px, 4vw, 28px);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
}

.ticket-search-panel {
    align-self: center;
    justify-self: end;
    width: min(100%, 460px);
}

.ticket-search-form {
    display: grid;
    gap: 16px;
    min-width: 0;
    max-width: 100%;
}

.modern-ticket-search {
    gap: 18px;
}

.ticket-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft-bg);
    min-width: 0;
    max-width: 100%;
}

.ticket-tabs label {
    display: block;
}

.ticket-tabs input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ticket-tabs span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 6px;
    color: var(--navy-soft);
    cursor: pointer;
    font-weight: 800;
}

.ticket-tabs label.is-active span,
.ticket-tabs input:checked + span {
    background: var(--navy);
    color: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.ticket-search-notice {
    margin: 0;
}

.route-fields {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
    align-items: stretch;
    gap: 10px;
}

.route-field,
.meta-field {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 12px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.route-field:focus-within,
.meta-field:focus-within {
    border-color: var(--gold-dark);
    box-shadow: 0 0 0 3px rgba(246, 195, 67, 0.22);
}

.field-kicker {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.route-field input,
.meta-field input,
.meta-field select {
    min-height: 34px;
    border: 0;
    border-radius: 0;
    padding: 4px 0 0;
    font-size: 17px;
    font-weight: 800;
    outline: 0;
}

.route-field input::placeholder {
    color: var(--navy);
    opacity: 0.55;
}

.route-swap {
    align-self: center;
    justify-self: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--navy);
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
}

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

.ticket-search-submit,
.ticket-search-submit.btn-primary {
    width: 100%;
    min-height: 52px;
    background: var(--navy);
    color: #fff;
    font-size: 16px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}

.ticket-search-submit:hover,
.ticket-search-submit.btn-primary:hover {
    background: #111827;
    color: #fff;
}

.section {
    padding: clamp(42px, 6vw, 76px) clamp(18px, 5vw, 72px);
}

.section-muted {
    background: var(--soft-bg);
}

.section-heading {
    max-width: 720px;
    margin-bottom: 24px;
}

.section-heading.compact {
    margin-bottom: 18px;
}

.section-heading h2 {
    margin-bottom: 8px;
    font-size: 30px;
    letter-spacing: 0;
}

.section-heading.compact h2 {
    font-size: 22px;
}

.section-heading p {
    margin-bottom: 0;
    color: var(--muted);
}

.review-form,
.admin-form {
    display: grid;
    gap: 16px;
}

.auth-required {
    display: grid;
    gap: 14px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: var(--soft-bg);
    padding: 16px;
}

.auth-required p {
    margin: 0;
    color: var(--navy-soft);
    font-weight: 800;
}

.auth-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.auth-required .auth-actions .btn {
    min-width: 128px;
}

.ticket-proof {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft-bg);
    padding: 14px;
}

.ticket-proof p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    min-width: 0;
}

label,
.rating-field {
    display: grid;
    gap: 8px;
    margin: 0;
    border: 0;
    padding: 0;
    color: var(--navy);
    font-size: 14px;
    font-weight: 800;
}

legend {
    margin-bottom: 8px;
    padding: 0;
}

input,
select,
textarea {
    max-width: 100%;
    width: 100%;
    min-height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: var(--navy);
    font: inherit;
    font-weight: 500;
    padding: 10px 12px;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--gold-dark);
    outline: 3px solid rgba(246, 195, 67, 0.28);
}

.rating-control {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
    max-width: 100%;
    flex-wrap: wrap;
}

.rating-control input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rating-control label {
    display: inline-block;
    cursor: pointer;
    color: #cbd5e1;
    font-size: 28px;
    line-height: 1;
}

.rating-control input:checked ~ label,
.rating-control label:hover,
.rating-control label:hover ~ label {
    color: var(--gold-dark);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    padding: 10px 16px;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--gold);
    color: var(--navy);
    box-shadow: 0 12px 24px rgba(216, 157, 21, 0.24);
}

.btn-primary:hover {
    background: #ffd767;
}

.btn-secondary {
    background: var(--navy);
    color: #fff;
}

.btn-danger {
    background: #fee4e2;
    color: var(--danger);
}

.btn-small {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
}

.company-grid,
.review-grid {
    display: grid;
    gap: 18px;
}

.company-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.review-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.company-card,
.review-card {
    display: grid;
    gap: 16px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 20px;
    overflow-wrap: anywhere;
}

.company-card h3,
.review-card h3 {
    margin: 10px 0 0;
    font-size: 20px;
}

.score-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
}

.score-row strong {
    color: var(--navy);
    font-size: 34px;
    line-height: 1;
}

.review-card-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.stars {
    min-width: 90px;
    color: var(--gold-dark);
    font-size: 18px;
    letter-spacing: 0;
    text-align: right;
}

.review-card p {
    color: var(--navy-soft);
}

.review-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    color: var(--muted);
    font-size: 14px;
}

.review-meta strong {
    color: var(--navy);
}

.empty-state {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    padding: 22px;
}

.flash {
    margin: 18px clamp(18px, 5vw, 72px) 0;
    border-radius: 8px;
    padding: 12px 14px;
    font-weight: 800;
}

.flash-success {
    background: #dcfae6;
    color: var(--success);
}

.flash-error {
    background: #fee4e2;
    color: var(--danger);
}

.site-footer {
    padding: 28px clamp(18px, 5vw, 72px);
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
}

.site-footer p {
    margin: 0;
}

.admin-shell {
    min-height: calc(100vh - 72px);
    background: var(--soft-bg);
    padding: clamp(24px, 5vw, 56px) clamp(18px, 5vw, 72px);
}

.auth-shell {
    min-height: calc(100vh - 72px);
    display: grid;
    place-items: center;
    background: var(--soft-bg);
    padding: clamp(24px, 5vw, 56px) clamp(18px, 5vw, 72px);
}

.auth-panel {
    width: min(100%, 460px);
    padding: 24px;
}

.auth-panel h1 {
    margin-bottom: 8px;
    font-size: 30px;
    line-height: 1.1;
}

.admin-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 24px;
}

.admin-sidebar,
.admin-content,
.admin-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.admin-sidebar {
    align-self: start;
    padding: 16px;
}

.admin-sidebar a {
    display: block;
    border-radius: 8px;
    color: var(--navy-soft);
    font-weight: 800;
    padding: 10px 12px;
}

.admin-sidebar a:hover {
    background: var(--soft-bg);
}

.admin-content,
.admin-panel {
    padding: 22px;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.table-wrap {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
}

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

.status {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 800;
}

.status-pending {
    background: #fff3cd;
    color: #8a5a00;
}

.status-approved {
    background: #dcfae6;
    color: var(--success);
}

.status-rejected,
.status-passive {
    background: #fee4e2;
    color: var(--danger);
}

.status-active {
    background: #dbeafe;
    color: #1d4ed8;
}

@media (max-width: 980px) {
    .hero,
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
    }

    .company-grid,
    .review-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .site-header {
        align-items: center;
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 12px;
        min-height: 68px;
        padding: 10px 16px;
        overflow: hidden;
    }

    .brand-logo {
        width: clamp(142px, 54vw, 190px);
        max-width: 100%;
        height: 46px;
        max-height: 46px;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .site-nav {
        display: none;
        grid-column: 1 / -1;
        width: 100%;
        max-width: 100%;
        align-items: stretch;
        flex-direction: column;
        border-top: 1px solid var(--line);
        padding-top: 12px;
        overflow: hidden;
    }

    .site-nav > a {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .site-nav.is-open {
        display: flex;
    }

    .mobile-menu-toggle[aria-expanded="true"] + .site-nav {
        display: flex;
    }

    .nav-auth {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .nav-auth .btn,
    .header-logout-form .btn {
        width: 100%;
        min-width: 0;
        padding-inline: 10px;
        white-space: normal;
    }

    .header-logout-form {
        width: 100%;
    }

    .mobile-only-auth {
        display: inline-flex !important;
    }

    .login-state {
        justify-content: center;
        min-width: 0;
        width: 100%;
    }

    .form-grid,
    .company-grid,
    .review-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: clamp(34px, 11vw, 42px);
    }

    .hero {
        width: 100%;
        max-width: 100vw;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 24px;
        padding: 28px 16px 42px;
        overflow: hidden;
        background-position: center top;
    }

    .review-hero,
    .ticket-hero {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

    .ticket-hero {
        contain: layout paint;
    }

    .hero-content {
        width: 100%;
        max-width: 100%;
    }

    .ticket-hero .hero-content,
    .ticket-hero .ticket-search-panel {
        flex: 0 1 auto;
        width: min(100%, calc(100vw - 32px));
        max-width: calc(100vw - 32px);
        margin-inline: auto;
    }

    .ticket-hero .ticket-search-panel {
        justify-self: auto;
    }

    .hero-panel,
    .admin-panel,
    .admin-content {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding: 18px;
        overflow: hidden;
    }

    .hero-copy {
        font-size: 18px;
    }

    .review-form,
    .ticket-search-form,
    .ticket-proof,
    .auth-required {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .ticket-search-form .form-grid,
    .ticket-tabs {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .route-fields,
    .trip-meta-grid {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
    }

    .route-swap {
        transform: rotate(90deg);
    }

    .route-field,
    .meta-field {
        padding: 11px;
    }

    .ticket-tabs span {
        min-width: 0;
        padding-inline: 8px;
    }

    input,
    select,
    textarea {
        min-width: 0;
    }

    .rating-control {
        justify-content: flex-start;
    }

    .section {
        width: 100%;
        max-width: 100vw;
        padding-inline: 16px;
        overflow: hidden;
    }

    .auth-panel {
        padding: 20px;
    }

    .review-card-top,
    .review-meta,
    .score-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .stars {
        text-align: left;
    }
}
