:root {
    --bg: #10131a;
    --bg-soft: #171c26;
    --panel: #202838;
    --panel-2: #273246;
    --line: rgba(255,255,255,.12);
    --text: #f6f7fb;
    --muted: #aeb8c9;
    --primary: #ffcc33;
    --primary-2: #ff6b4a;
    --accent: #43d7b5;
    --danger: #ff4f6d;
    --shadow: 0 24px 70px rgba(0,0,0,.32);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
}

body {
    min-width: 320px;
}

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

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

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

input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text);
    background: #121722;
    outline: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255,204,51,.14);
}

.btn {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text);
    background: #263247;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    font-weight: 800;
    transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    background: #303d56;
}

.btn:disabled {
    opacity: .62;
    cursor: not-allowed;
}

.btn.primary {
    color: #1d1600;
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), #ff9f2f);
    box-shadow: 0 12px 24px rgba(255,159,47,.25);
}

.btn.ghost {
    background: transparent;
}

.btn.small {
    min-height: 36px;
    padding: 8px 12px;
}

.btn.tiny {
    min-height: 32px;
    padding: 6px 9px;
    border-radius: 7px;
    font-size: 12px;
}

.btn.danger {
    color: #fff;
    background: rgba(255,79,109,.2);
    border-color: rgba(255,79,109,.45);
}

.notice {
    border-radius: 8px;
    padding: 12px 14px;
    font-weight: 700;
    margin: 12px 0;
}

.notice.error {
    background: rgba(255,79,109,.13);
    border: 1px solid rgba(255,79,109,.38);
}

.notice.warn {
    background: rgba(255,204,51,.13);
    border: 1px solid rgba(255,204,51,.34);
}

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

.center {
    text-align: center;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at 18% 20%, rgba(67,215,181,.18), transparent 32%),
        radial-gradient(circle at 85% 15%, rgba(255,204,51,.16), transparent 28%),
        linear-gradient(135deg, #0f1420, #1b2130 56%, #111620);
}

.auth-shell {
    width: min(1080px, 100%);
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 24px;
    align-items: stretch;
}

.auth-shell.compact {
    grid-template-columns: minmax(320px, 520px);
    justify-content: center;
}

.auth-art, .auth-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.auth-art {
    position: relative;
    min-height: 520px;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background:
        linear-gradient(rgba(16,19,26,.25), rgba(16,19,26,.88)),
        repeating-linear-gradient(0deg, rgba(255,255,255,.08) 0 2px, transparent 2px 54px),
        repeating-linear-gradient(90deg, rgba(255,255,255,.08) 0 2px, transparent 2px 54px),
        linear-gradient(145deg, #263247, #151b28);
}

.brand-mark {
    position: absolute;
    align-self: flex-start;
    top: 48px;
    width: 76px;
    height: 76px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #1d1600;
    background: var(--primary);
    font-weight: 950;
    font-size: 24px;
}

.auth-art h1 {
    max-width: 620px;
    margin: 0 0 14px;
    font-size: clamp(38px, 5vw, 70px);
    line-height: .95;
}

.auth-art p {
    max-width: 560px;
    color: #d7deea;
    font-size: 18px;
}

.auth-card {
    padding: 30px;
    background: rgba(32,40,56,.92);
}

.auth-card.wide {
    width: 100%;
}

.auth-card h2 {
    margin-top: 0;
    font-size: 34px;
}

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

.app-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: block;
    padding: 20px;
    background: rgba(0,0,0,.66);
    backdrop-filter: blur(4px);
    overflow: hidden;
}

.app-modal {
    width: min(440px, 100%);
    max-height: calc(100vh - 40px);
    position: fixed;
    top: 50%;
    left: 50%;
    display: grid;
    gap: 16px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #fff;
    background: #242b36;
    box-shadow: 0 24px 80px rgba(0,0,0,.62);
    overflow: auto;
    transform: translate(-50%, -50%);
}

.app-toast-stack {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 40000;
    width: min(360px, calc(100vw - 32px));
    display: grid;
    gap: 10px;
    pointer-events: none;
}

.app-toast {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid rgba(255,204,51,.42);
    border-radius: 8px;
    color: #fff;
    background: #242b36;
    box-shadow: 0 16px 44px rgba(0,0,0,.38);
    animation: toastIn .18s ease-out;
}

.app-toast strong {
    color: #ffcc33;
    font-size: 12px;
}

.app-toast span {
    color: #fff;
    font-size: 13px;
    line-height: 1.35;
}

.app-toast.leaving {
    opacity: 0;
    transform: translateX(12px);
    transition: opacity .28s ease, transform .28s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.app-modal h2 {
    margin: 0;
    font-size: 22px;
    color: #fff;
}

.app-modal p {
    margin: 0;
    color: #fff;
    line-height: 1.45;
}

.app-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 820px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-art {
        min-height: 320px;
        padding: 32px;
    }
}
