:root {
    color-scheme: dark;
    --background: #0f0f0f;
    --surface: #1b1b1b;
    --text: #f7f7f7;
    --muted: #b7b7b7;
    --accent: #e50914;
    --accent-hover: #f6121d;
    --radius: 16px;
    --success: #24a148;
    --warning: #f1a208;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
}

html {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--background);
}

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

button,
a {
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
}

.container {
    width: min(100% - 28px, 1100px);
    margin-inline: auto;
    padding-block: 32px;
}

.card {
    padding: 24px;
    border: 1px solid #303030;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 16px 40px rgb(0 0 0 / 25%);
    margin-bottom: 18px;
}

.hero {
    margin-top: clamp(24px, 10vh, 96px);
}

h1 {
    margin: 0 0 12px;
    font-size: clamp(1.8rem, 8vw, 2.6rem);
    line-height: 1.1;
}

p {
    margin: 0 0 20px;
    color: var(--muted);
}

h2,
h3,
h4 {
    margin-top: 0;
}

.eyebrow {
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 10px;
    color: #fff;
    background: var(--accent);
    font-weight: 700;
    text-decoration: none;
    touch-action: manipulation;
    border: 0;
    cursor: pointer;
}

.button:hover,
.button:focus-visible {
    background: var(--accent-hover);
}

.text-link {
    font-weight: 600;
    text-underline-offset: 4px;
}

.button.secondary {
    background: #333;
}

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

.button.small {
    min-height: 42px;
    padding: 9px 14px;
}

.button.full {
    width: 100%;
}

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

.center {
    text-align: center;
}

.subtle {
    font-size: .85rem;
    opacity: .75;
}

.site-header {
    width: min(100% - 28px, 1100px);
    min-height: 76px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.brand img {
    display: block;
    width: clamp(52px, 14vw, 68px);
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgb(0 0 0 / 40%));
}

.hero-logo {
    display: block;
    width: min(68vw, 300px);
    height: auto;
    margin: 0 auto 22px;
    filter: drop-shadow(0 12px 28px rgb(0 0 0 / 45%));
}

.language {
    display: flex;
    gap: 4px;
}

.language a {
    padding: 7px 9px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
}

.language .active {
    color: white;
    background: var(--accent);
}

.nav,
.customer-nav {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding: 8px max(14px, calc((100% - 1100px) / 2));
    background: #171717;
    scrollbar-width: none;
}

.nav a,
.customer-nav a {
    flex: 0 0 auto;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
}

.nav a:hover,
.customer-nav a:hover {
    color: white;
    background: #292929;
}

.customer-nav {
    position: sticky;
    bottom: 8px;
    justify-content: space-around;
    margin-top: 24px;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 8px 30px #000;
}

.footer {
    padding: 30px 14px;
    color: #777;
    font-size: .8rem;
    text-align: center;
}

label {
    display: grid;
    gap: 7px;
    margin-bottom: 16px;
    color: #ddd;
    font-weight: 600;
}

label small {
    color: var(--muted);
    font-weight: 400;
}

input,
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: 11px 12px;
    border: 1px solid #444;
    border-radius: 9px;
    outline: none;
    color: white;
    background: #111;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(229 9 20 / 18%);
}

.inline-form,
.filters,
.review-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 8px;
    margin-bottom: 18px;
}

.inline-form input,
.filters input,
.filters select,
.review-form input {
    flex: 1 1 150px;
}

.alert {
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid #444;
    border-radius: 10px;
    background: #222;
}

.alert.error {
    border-color: var(--danger);
    background: rgb(239 68 68 / 12%);
}

.alert.success {
    border-color: var(--success);
    background: rgb(36 161 72 / 12%);
}

.alert.warning,
.notice {
    border-color: var(--warning);
    background: rgb(241 162 8 / 10%);
}

.grid,
.stats,
.form-grid {
    display: grid;
    gap: 14px;
}

.page-title,
.card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.page-title h1,
.card-heading h2,
.card-heading h3 {
    margin: 0;
}

dl {
    margin: 0 0 18px;
}

dl > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid #333;
}

dt {
    color: var(--muted);
}

dd {
    margin: 0;
    text-align: right;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    color: #ddd;
    background: #393939;
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
}

.badge-active,
.badge-available,
.badge-confirmed {
    color: #9df5b4;
    background: rgb(36 161 72 / 22%);
}

.badge-pending,
.badge-pending_payment,
.badge-partially_available,
.badge-due {
    color: #ffd67a;
    background: rgb(241 162 8 / 20%);
}

.badge-rejected,
.badge-locked,
.badge-full,
.badge-cancelled,
.badge-expired {
    color: #ffaaaa;
    background: rgb(239 68 68 / 20%);
}

.badge-reserved,
.badge-personal,
.badge-inactive {
    color: #c8c8c8;
    background: #343434;
}

.steps {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 5px 0 24px;
}

.steps span {
    width: 11px;
    height: 11px;
    overflow: hidden;
    border-radius: 50%;
    color: transparent;
    background: #444;
}

.steps .active {
    background: var(--accent);
}

.check {
    grid-template-columns: 24px 1fr;
    align-items: start;
    padding: 13px;
    border: 1px solid #444;
    border-radius: 10px;
}

.check input {
    min-height: auto;
    margin: 3px 0;
}

.bank-details dd,
.secret {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.copy-button {
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid #555;
    border-radius: 7px;
    color: white;
    background: #292929;
    cursor: pointer;
}

.credentials,
.notice {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid #3b3b3b;
    border-radius: 12px;
}

.secret {
    padding: 11px 0;
    border-bottom: 1px solid #333;
}

.secret span {
    min-width: 0;
}

.secret small,
.secret strong {
    display: block;
}

.secret strong {
    overflow-wrap: anywhere;
}

.table-wrap {
    margin-bottom: 24px;
    overflow-x: auto;
    border: 1px solid #333;
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #333;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    background: #181818;
    font-size: .78rem;
    text-transform: uppercase;
}

.stat {
    display: grid;
    gap: 5px;
    padding: 18px;
    border: 1px solid #333;
    border-radius: 12px;
    background: var(--surface);
}

.stat strong {
    font-size: 1.55rem;
}

.stat span {
    color: var(--muted);
    font-size: .83rem;
}

.empty {
    margin-bottom: 20px;
    padding: 24px;
    border: 1px dashed #444;
    border-radius: 12px;
    color: var(--muted);
    text-align: center;
}

details {
    margin-top: 18px;
}

summary {
    padding: 8px 0;
    cursor: pointer;
    font-weight: 700;
}

.loading-screen {
    display: none;
}

.js .loading-screen {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 8px;
    text-align: center;
    background: var(--background);
    transition: opacity .18s ease;
}

.loading-screen img {
    width: min(42vw, 170px);
    height: auto;
    margin: 0 auto;
}

.js .loading-screen.hidden {
    pointer-events: none;
    opacity: 0;
}

.sticky-save {
    position: sticky;
    bottom: 10px;
    box-shadow: 0 5px 30px #000;
}

.narrow {
    max-width: 480px;
    margin-inline: auto;
}

@media (max-width: 639px) {
    .responsive-table {
        overflow: visible;
        border: 0;
    }

    .responsive-table table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        min-width: 0;
        width: 100%;
    }

    .responsive-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .responsive-table tr {
        margin-bottom: 12px;
        padding: 8px 12px;
        border: 1px solid #333;
        border-radius: 12px;
        background: var(--surface);
    }

    .responsive-table td {
        display: flex;
        justify-content: space-between;
        gap: 14px;
        padding: 10px 0;
        text-align: right;
    }

    .responsive-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 700;
        text-align: left;
    }
}

@media (min-width: 640px) {
    .container {
        padding-block: 48px;
    }

    .card {
        padding: 40px;
    }

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

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

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

    .hero {
        max-width: 680px;
        margin-inline: auto;
    }
}
