:root {
    --bg: #06080d;
    --panel: rgba(15, 18, 29, .86);
    --panel-2: rgba(23, 27, 43, .72);
    --border: rgba(255, 255, 255, .09);
    --text: #f5f7fb;
    --muted: #9ca3b7;
    --purple: #7c3aed;
    --purple-2: #a855f7;
    --gold: #f5b942;
    --green: #43d17a;
    --danger: #ef4444;
    --shadow: 0 24px 80px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 10%, rgba(124, 58, 237, .30), transparent 28%),
        radial-gradient(circle at 85% 15%, rgba(245, 185, 66, .14), transparent 24%),
        radial-gradient(circle at 70% 90%, rgba(67, 209, 122, .12), transparent 24%),
        linear-gradient(135deg, #05060a 0%, #090d17 48%, #05060a 100%);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at center, black, transparent 74%);
}

.page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 42px;
    align-items: center;
    padding: 48px clamp(24px, 5vw, 88px);
    position: relative;
}

.brand {
    max-width: 620px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 42px;
    font-weight: 800;
    letter-spacing: .5px;
    font-size: 22px;
}

.logo-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, rgba(124,58,237,.28), rgba(245,185,66,.18));
    border: 1px solid var(--border);
    box-shadow: 0 0 36px rgba(124,58,237,.28);
}

h1 {
    margin: 0;
    font-size: clamp(44px, 6vw, 82px);
    line-height: .95;
    letter-spacing: -4px;
}

.gradient-text {
    background: linear-gradient(90deg, #fff, #d7c4ff 45%, #f7c85b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lead {
    margin: 28px 0 0;
    max-width: 540px;
    font-size: 18px;
    line-height: 1.7;
    color: var(--muted);
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 34px;
    max-width: 560px;
}

.stat-card {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(255, 255, 255, .045);
    backdrop-filter: blur(16px);
}

.stat-card strong {
    display: block;
    font-size: 20px;
    margin-bottom: 6px;
}

.stat-card span {
    color: var(--muted);
    font-size: 13px;
}

.auth-stack {
    width: min(100%, 460px);
    margin-left: auto;
    display: grid;
    gap: 22px;
}

.contact-page {
    min-height: calc(100vh - 90px);
}

.contact-card {
    width: 100%;
}

.auth-card {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(18,22,36,.92), rgba(9,12,20,.92));
    border-radius: 32px;
    padding: 30px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    background: radial-gradient(circle at 50% 0%, rgba(124,58,237,.22), transparent 42%);
    pointer-events: none;
}

.auth-card > * { position: relative; }

.auth-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.auth-header h2 {
    margin: 0 0 8px;
    font-size: 28px;
    letter-spacing: -1px;
}

.auth-header p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.badge {
    flex: none;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(124,58,237,.16);
    color: #d8c7ff;
    border: 1px solid rgba(168,85,247,.30);
    font-size: 12px;
    font-weight: 700;
}

.form { display: grid; gap: 15px; }

.field { display: grid; gap: 8px; }

label {
    color: #dce1ee;
    font-size: 13px;
    font-weight: 700;
}

input {
    width: 100%;
    height: 50px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(2, 4, 10, .56);
    color: var(--text);
    padding: 0 15px;
    outline: none;
    font: inherit;
    transition: .2s ease;
}

input:focus {
    border-color: rgba(168,85,247,.70);
    box-shadow: 0 0 0 4px rgba(124,58,237,.18);
}

textarea {
    width: 100%;
    min-height: 180px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(2, 4, 10, .56);
    color: var(--text);
    padding: 14px 15px;
    outline: none;
    font: inherit;
    resize: vertical;
    transition: .2s ease;
}

textarea:focus {
    border-color: rgba(168,85,247,.70);
    box-shadow: 0 0 0 4px rgba(124,58,237,.18);
}

input::placeholder { color: #5f6679; }
textarea::placeholder { color: #5f6679; }

.row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    color: var(--muted);
    font-size: 13px;
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.check input {
    width: 16px;
    height: 16px;
    accent-color: var(--purple);
}

a { color: #c4a7ff; text-decoration: none; font-weight: 700; }
a:hover { color: #fff; }

.btn {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 16px;
    color: white;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    background: linear-gradient(135deg, var(--purple), var(--purple-2));
    box-shadow: 0 14px 34px rgba(124,58,237,.35);
    transition: transform .2s ease, filter .2s ease;
}

.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }

.btn-secondary {
    margin-top: -4px;
    background: rgba(255,255,255,.055);
    border: 1px solid var(--border);
    box-shadow: none;
    color: var(--text);
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
    margin: 5px 0;
}

.divider::before,
.divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--border);
}

.social {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.social button,
.social a {
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255,255,255,.045);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.switch {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    margin-top: 18px;
}

.mini-preview {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 16px;
    align-items: center;
    margin-top: 22px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(255,255,255,.04);
}

.avatar {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    font-size: 30px;
    background: linear-gradient(145deg, rgba(124,58,237,.28), rgba(245,185,66,.18));
    border: 1px solid rgba(255,255,255,.10);
}

.bar {
    height: 9px;
    background: rgba(255,255,255,.08);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 9px;
}

.bar span {
    display: block;
    height: 100%;
    width: 62%;
    background: linear-gradient(90deg, var(--purple), var(--gold));
    border-radius: inherit;
}

.tabs {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(8, 10, 16, .80);
    border: 1px solid var(--border);
    backdrop-filter: blur(18px);
    z-index: 10;
}

.tabs a {
    padding: 11px 16px;
    border-radius: 13px;
    color: var(--muted);
    font-size: 13px;
}

.tabs a.active {
    background: rgba(124,58,237,.24);
    color: white;
}

.screen { display: none; }
.screen:target { display: grid; }
body:not(:has(:target)) #login { display: grid; }
body.show-register #login { display: none !important; }
body.show-register #register { display: grid !important; }
body.show-register .tabs a[href="#login"] { color: var(--muted); background: transparent; }
body.show-register .tabs a[href="#register"] { background: rgba(124,58,237,.24); color: white; }

.alert {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(239, 68, 68, .28);
    background: rgba(239, 68, 68, .10);
    color: #fecaca;
    font-size: 14px;
    line-height: 1.5;
}

.alert-success {
    border: 1px solid rgba(67, 209, 122, .28);
    background: rgba(67, 209, 122, .10);
    color: #bbf7d0;
}

.field-error {
    color: #fca5a5;
    font-size: 12px;
    font-weight: 700;
}

.helper {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 980px) {
    .page { grid-template-columns: 1fr; padding-bottom: 110px; }
    .auth-stack { margin: 0; width: 100%; max-width: 520px; }
    .stats { grid-template-columns: 1fr; }
    h1 { letter-spacing: -2px; }
}

@media (max-width: 560px) {
    .page { padding: 26px 16px 96px; }
    .auth-card { padding: 22px; border-radius: 26px; }
    .social { grid-template-columns: 1fr; }
    .row { align-items: flex-start; flex-direction: column; }
}

.top-menu {
    position: fixed;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100% - 32px), 1180px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(8,10,16,.72);
    backdrop-filter: blur(22px);
    z-index: 50;
    box-shadow: 0 18px 58px rgba(0,0,0,.30);
}

.top-brand img {
    height: 36px;
    width: auto;
    display: block;
}

.top-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    padding: 11px 14px;
    border-radius: 14px;
}

.top-links a:hover {
    color: var(--text);
    background: rgba(255,255,255,.055);
}

.top-links .top-cta {
    color: #171008;
    background: linear-gradient(135deg, var(--gold), #ffd66b);
    box-shadow: 0 12px 28px rgba(245,185,66,.20);
}

.welcome-footer {
    width: 100%;
    padding: 0 16px 24px;
    margin-top: 12px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    z-index: 20;
}

.welcome-footer p {
    margin: 0;
    padding: 12px 18px;
    border-radius: 18px;
    background: rgba(8, 10, 16, .72);
    backdrop-filter: blur(22px);
    box-shadow: 0 18px 58px rgba(0, 0, 0, .30);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.welcome-footer a {
    color: var(--text);
    font-weight: 800;
    margin-left: 6px;
}

.welcome-footer a + a {
    margin-left: 4px;
}

.welcome-footer a:hover {
    color: #fff;
}

.legal-page + .welcome-footer {
    margin-top: -8px;
}

@media (min-width: 981px) {
    .page { padding-top: 138px; }
}

@media (max-width: 700px) {
    .top-menu { flex-direction: column; align-items: flex-start; }
    .top-links { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
    .page { padding-top: 180px; }
    .welcome-footer {
        padding: 0 12px 14px;
    }

    .welcome-footer p {
        width: 100%;
    }
}
