:root {
    --bg: #0b0f19;
    --bg-elevated: #0b111f;
    --bg-lighter: #1a2035;
    --card: #111827;
    --line: rgba(255, 255, 255, 0.08);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --primary: #4f8fff;
    --primary-dark: #3b6fd9;
    --accent: #06d6a0;
    --purple: #8b5cf6;
    --danger: #ff6b6b;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
}

html {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg);
}

*::-webkit-scrollbar {
    width: 8px;
    height: 12px;
}

*::-webkit-scrollbar-track {
    background: var(--bg);
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--purple));
    border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark), var(--purple));
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.panel-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.panel-card__header h2,
.panel-card--state h1 {
    margin: 0 0 8px;
    font-size: 1.35rem;
}

.panel-card__header p,
.panel-card__content p,
.panel-card--state p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.panel-auth__badge,
.panel-topbar__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(79, 143, 255, 0.1);
    border: 1px solid rgba(79, 143, 255, 0.2);
    color: var(--primary);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.panel-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 24px;
    border-radius: 10px;
    border: 1px solid transparent;
    text-decoration: none;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

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

.panel-button--primary {
    background: var(--primary);
    color: #fff;
}

.panel-button--primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 8px 24px rgba(79, 143, 255, 0.3);
}

.panel-button--ghost {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
    color: var(--text);
}

.panel-alert {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 0.95rem;
}

.panel-alert--error {
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.2);
    color: #ff9d9d;
}

.panel-alert--success {
    background: rgba(6, 214, 160, 0.12);
    border: 1px solid rgba(6, 214, 160, 0.2);
    color: #a8f4df;
}

.panel-simple-state {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.panel-card--state {
    width: min(520px, 100%);
    text-align: center;
    padding: 24px;
}

.panel-card--state .panel-button {
    margin-top: 18px;
}

.panel-toast-stack {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
    width: min(420px, calc(100vw - 24px));
    pointer-events: none;
}

.panel-toast {
    --panel-toast-duration: 7000ms;
    position: relative;
    width: 100%;
    overflow: hidden;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 24px;
    align-items: start;
    gap: 10px;
    padding: 12px 14px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(9, 14, 26, 0.94);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(12px);
    transform: translateY(18px);
    opacity: 0;
    pointer-events: auto;
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.panel-toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.panel-toast.is-hiding {
    transform: translateY(12px);
    opacity: 0;
}

.panel-toast__icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 0.96rem;
}

.panel-toast__content {
    min-width: 0;
}

.panel-toast__content strong {
    display: block;
    margin-bottom: 2px;
    font-size: 0.88rem;
    line-height: 1.2;
}

.panel-toast__content p {
    margin: 0;
    color: #d7e2f4;
    font-size: 0.86rem;
    line-height: 1.4;
    word-break: break-word;
}

.panel-toast__close {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #90a0b8;
    cursor: pointer;
    font-size: 0.86rem;
    transition: background 0.2s ease, color 0.2s ease;
}

.panel-toast__close:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.panel-toast__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    transform-origin: left center;
    animation: panel-toast-progress var(--panel-toast-duration) linear forwards;
}

.panel-toast--success {
    border-color: rgba(6, 214, 160, 0.22);
    background: linear-gradient(180deg, rgba(8, 29, 28, 0.96), rgba(7, 20, 26, 0.96));
}

.panel-toast--success .panel-toast__icon {
    background: rgba(6, 214, 160, 0.16);
    color: #53e3bc;
}

.panel-toast--success .panel-toast__content strong {
    color: #c7ffef;
}

.panel-toast--success .panel-toast__progress {
    background: linear-gradient(90deg, #06d6a0, #4bf0c3);
}

.panel-toast--error {
    border-color: rgba(255, 107, 107, 0.24);
    background: linear-gradient(180deg, rgba(39, 15, 22, 0.96), rgba(20, 10, 18, 0.96));
}

.panel-toast--error .panel-toast__icon {
    background: rgba(255, 107, 107, 0.16);
    color: #ff9f9f;
}

.panel-toast--error .panel-toast__content strong {
    color: #ffd6d6;
}

.panel-toast--error .panel-toast__progress {
    background: linear-gradient(90deg, #ff6b6b, #ff9f9f);
}

@keyframes panel-toast-progress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@media (max-width: 640px) {
    .panel-toast-stack {
        right: 12px;
        bottom: 12px;
        width: calc(100vw - 24px);
    }

    .panel-toast {
        grid-template-columns: 34px minmax(0, 1fr) 24px;
        gap: 10px;
        padding: 11px 12px 13px;
    }

    .panel-toast__icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }
}
