:root {
    --bg: #0f1419;
    --bg-alt: #121a22;
    --card: #1a2332;
    --text: #e8eef7;
    --muted: #9aa8bc;
    --accent: #3d8bfd;
    --accent-hover: #5ca0ff;
    --danger-bg: #3a1f24;
    --danger-border: #c44c5a;
    --danger-text: #ffb4bc;
    --radius: 14px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    --content-max: min(96vw, 1680px);
    --modal-max: min(94vw, 1200px);
    --modal-mant-max: min(98vw, 1760px);
    --modal-form-max: min(92vw, 640px);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100dvh;
    background: radial-gradient(1200px 600px at 10% -10%, #1f3a5c 0%, transparent 55%),
        radial-gradient(900px 500px at 110% 20%, #2a1f4a 0%, transparent 50%),
        var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 4vw, 2.5rem);
}

.page--alt {
    flex-direction: column;
    align-items: stretch;
    padding: clamp(0.75rem, 2vw, 1.25rem);
}

.shell {
    width: min(440px, 100%);
}

.shell--wide {
    width: var(--content-max);
    max-width: 100%;
    margin: 0 auto;
    padding: clamp(0.75rem, 2vw, 1.5rem);
}

.card--wide {
    max-width: none;
    width: 100%;
    margin: 0;
}

.card {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), transparent 40%), var(--card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: clamp(1.25rem, 3vw, 2rem);
    box-shadow: var(--shadow);
    width: 100%;
}

.card__title {
    margin: 0.75rem 0 0.35rem;
    font-size: clamp(1.35rem, 4vw, 1.6rem);
    font-weight: 650;
    letter-spacing: -0.02em;
}

.card__text {
    margin: 0 0 0.75rem;
    color: var(--muted);
    font-size: 0.95rem;
}

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

.brand {
    font-weight: 800;
    letter-spacing: -0.03em;
    font-size: 1.15rem;
    color: var(--text);
    text-decoration: none;
}

.brand span {
    color: var(--accent);
}

.brand--center {
    display: block;
    text-align: center;
    margin-bottom: 0.25rem;
}

.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 1rem clamp(1rem, 4vw, 2rem);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 20, 25, 0.75);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 2;
}

.topbar__main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1.25rem;
    flex: 1 1 auto;
    min-width: 0;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.35rem;
}

.nav__link {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.nav__link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.nav__link--active {
    color: var(--text);
    background: rgba(61, 139, 253, 0.15);
    border-color: rgba(61, 139, 253, 0.35);
}

.form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.field__label {
    font-size: 0.85rem;
    color: var(--muted);
}

.field__input {
    width: 100%;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(61, 139, 253, 0.25);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

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

.btn--primary {
    background: var(--accent);
    color: #0a0f14;
    margin-top: 0.25rem;
}

.btn--primary:hover {
    background: var(--accent-hover);
}

.btn--ghost {
    background: transparent;
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.18);
}

.btn--ghost:hover {
    border-color: rgba(255, 255, 255, 0.35);
}

.alert {
    margin: 0.5rem 0 0;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert--error {
    background: var(--danger-bg);
    border-color: var(--danger-border);
    color: var(--danger-text);
}

.alert--ok {
    background: #152a1f;
    border-color: #3d8b5c;
    color: #c4efd4;
}

.fade-in {
    animation: fade 0.45s ease both;
}

@keyframes fade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fade-in {
        animation: none;
    }
}
