:root {
    color-scheme: light;
    --page-bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f7fafc;
    --text: #1f2937;
    --muted: #5f6b7a;
    --brand: #315c9f;
    --brand-hover: #244b86;
    --success: #22864f;
    --warning: #b7791f;
    --danger: #d13b3b;
    --pay-start: #c98b2d;
    --pay-end: #df6d55;
    --border: #dce3ee;
    --shadow: 0 10px 30px rgba(31, 41, 55, 0.12);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 96px 20px 40px;
    background: var(--page-bg);
    color: var(--text);
    font-family: "Segoe UI", Arial, sans-serif;
}

.top-navbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 20;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 68px;
    padding: 14px 30px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(31, 41, 55, 0.06);
}

.auth-actions,
.auth-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.user-summary {
    color: #303846;
    font-size: 15px;
}

.divider {
    color: #9aa4b2;
    margin: 0 6px;
}

.balance {
    color: #c93232;
    font-weight: 700;
    margin: 0 4px;
}

.button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 20px;
    padding: 8px 18px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.16s ease, filter 0.16s ease, opacity 0.16s ease;
}

.button:hover {
    transform: translateY(-1px);
    filter: brightness(0.97);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.68;
    transform: none;
}

.button-success {
    background: var(--success);
}

.button-warning {
    background: var(--warning);
}

.button-primary {
    background: var(--brand);
}

.button-danger {
    background: var(--danger);
}

.button-pay {
    background: linear-gradient(135deg, var(--pay-start), var(--pay-end));
}

.button-full {
    width: 100%;
    border-radius: 6px;
}
.button-stacked {
    margin-top: 8px;
}

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 30px 34px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
}

h1 {
    margin: 0 0 12px;
    color: #263f73;
    font-size: 36px;
    line-height: 1.2;
    letter-spacing: 0;
}

p {
    margin: 0 0 30px;
    color: var(--muted);
    font-size: 17px;
}

.card-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.card {
    min-height: 96px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: #b8c7dc;
    box-shadow: 0 8px 22px rgba(49, 92, 159, 0.15);
}

.card a {
    display: flex;
    min-height: 96px;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #263f73;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.45;
    text-decoration: none;
}

.card a:hover {
    color: var(--brand-hover);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(18, 24, 38, 0.52);
}

.modal-panel {
    width: min(340px, 100%);
    margin: 0;
    padding: 28px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
}
.payment-panel {
    width: min(400px, 100%);
}

.modal-panel h2 {
    margin: 0 0 18px;
    font-size: 24px;
    line-height: 1.25;
}

.field {
    width: 100%;
    min-height: 42px;
    margin: 8px 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
}

.field:focus {
    outline: 2px solid rgba(49, 92, 159, 0.2);
    border-color: var(--brand);
}

.message {
    min-height: 20px;
    margin-top: 10px;
    color: #d32f2f;
    font-size: 13px;
    line-height: 1.5;
}

.message.is-success {
    color: #2e7d32;
}
.order-info {
    margin-bottom: 10px;
    color: #303846;
    font-size: 14px;
    line-height: 1.6;
}
.qr-frame {
    display: flex;
    width: 232px;
    height: 232px;
    align-items: center;
    justify-content: center;
    margin: 12px auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
}
.qr-frame img {
    width: 210px;
    height: 210px;
    object-fit: contain;
}
.payment-note {
    min-height: 18px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}
.pay-url {
    max-height: 54px;
    margin-bottom: 10px;
    overflow: auto;
    color: #697386;
    font-size: 12px;
    line-height: 1.5;
    word-break: break-all;
}

.text-button {
    margin-top: 10px;
    border: 0;
    background: transparent;
    color: #697386;
    font: inherit;
    cursor: pointer;
}

.text-button:hover {
    color: var(--text);
}

@media (max-width: 680px) {
    body {
        padding: 126px 14px 28px;
    }

    .top-navbar {
        justify-content: center;
        padding: 12px 14px;
    }

    .auth-actions,
    .auth-panel {
        justify-content: center;
    }

    .user-summary {
        width: 100%;
        text-align: center;
    }

    .container {
        padding: 24px 16px;
    }

    h1 {
        font-size: 28px;
    }

    .card-list {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}