:root {
    --bg-0: #0d0d0d;
    --bg-1: #141414;
    --line: rgba(255, 255, 255, .08);
    --line-soft: rgba(255, 255, 255, .05);
    --ink-0: #ffffff;
    --ink-1: #9e9e9e;
    --ink-2: #6b6b6b;
    --gold: #f3ba2f;
    --gold-deep: #e8a317;
    --blue: var(--gold);
    --violet: var(--gold-deep);
    --success: #00e676;
    --danger: #ff5252;
    --grad: linear-gradient(120deg, var(--gold), var(--gold-deep));
}

* { box-sizing: border-box; }
html, body {
    height: 100%;
    overflow: hidden;
}

body {
    margin: 0;
    background: var(--bg-0);
    color: var(--ink-0);
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-height: 100dvh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(700px 420px at 12% -6%, rgba(243, 186, 47, .12), transparent 60%),
        radial-gradient(800px 520px at 92% 8%, rgba(232, 163, 23, .10), transparent 60%),
        radial-gradient(900px 600px at 50% 110%, rgba(243, 186, 47, .07), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.container { position: relative; z-index: 1; }
h1, h2, h3, .font-display { font-family: 'Space Grotesk', sans-serif; letter-spacing: -.01em; }
a { text-decoration: none; }
.text-ink-1 { color: var(--ink-1) !important; }
.text-ink-2 { color: var(--ink-2) !important; }
.grad-text {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.site-header {
    flex-shrink: 0;
    background: rgba(13, 13, 13, .78);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line-soft);
}

.site-header .navbar { padding-top: .75rem; padding-bottom: .75rem; }
.site-header .container { justify-content: flex-start; }
.site-header-back { color: #fff; }
.site-header-back:hover { color: var(--gold); }

.auth-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    padding: 1.25rem 0;
    overflow: hidden;
}

.auth-footer {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    padding: .85rem 1rem 1rem;
    margin-top: 0;
}

.eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: .72rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink-2);
}

.eyebrow .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(120deg, var(--blue), var(--violet));
    margin-inline-end: 8px;
    vertical-align: middle;
}

.auth-box-col {
    width: 500px;
    max-width: 100%;
}

.auth-card {
    width: 500px;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .012));
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .75);
    padding: 2.2rem;
    position: relative;
    overflow: hidden;
}

@media (max-height: 820px) {
    .auth-wrap { padding: .75rem 0; }
    .auth-card { padding: 1.5rem; }
    .auth-footer { padding: .6rem 1rem .75rem; }
}

@media (max-height: 700px) {
    .site-header .navbar { padding-top: .5rem; padding-bottom: .5rem; }
    .auth-wrap { padding: .5rem 0; }
    .auth-card { padding: 1.15rem; }
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    padding: 1px;
    border-radius: 20px;
    background: var(--grad);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: .3;
    pointer-events: none;
}

.auth-mode-switch {
    color: var(--ink-1);
}

.auth-mode-link {
    color: var(--gold);
    font-weight: 600;
    transition: color .2s;
}

.auth-mode-link:hover {
    color: #fff;
}

.auth-mode-link.is-disabled {
    opacity: .55;
    pointer-events: none;
    cursor: not-allowed;
}

.auth-forms-viewport {
    overflow: hidden;
    width: 100%;
    transition: height .35s cubic-bezier(.22, 1, .36, 1);
}

.auth-forms-track {
    display: flex;
    align-items: flex-start;
    width: 200%;
    transition: transform .35s cubic-bezier(.22, 1, .36, 1);
    will-change: transform;
}

.auth-forms-track.is-login {
    transform: translateX(0);
}

.auth-forms-track.is-register {
    transform: translateX(-50%);
}

.auth-form-panel {
    width: 50%;
    flex: 0 0 50%;
    min-width: 0;
    padding: 0 .05rem;
}

.field-label {
    font-size: .82rem;
    color: var(--ink-1);
    margin-bottom: .4rem;
    display: block;
}

.field-control {
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--line);
    color: #fff;
    font-size: .92rem;
    padding: .65rem .85rem;
    border-radius: 10px;
    width: 100%;
}

.field-control::placeholder { color: var(--ink-2); }

.field-control:focus {
    background: rgba(255, 255, 255, .05);
    border-color: rgba(255, 255, 255, .3);
    box-shadow: 0 0 0 3px rgba(243, 186, 47, .15);
    outline: none;
    color: #fff;
}

.field-control-ltr {
    direction: ltr;
    text-align: center;
}

.field-hint {
    font-size: .76rem;
    color: var(--ink-2);
    margin-top: .35rem;
}

.field-hint.err { color: #ff9a9a; }

.input-icon-wrap { position: relative; }

.input-icon-wrap i {
    position: absolute;
    right: .85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-2);
    cursor: pointer;
    font-size: .95rem;
}

.input-icon-wrap .field-control { padding-right: 2.4rem; }

.btn-grad {
    background: var(--grad);
    color: #0d0d0d !important;
    font-weight: 600;
    border: none;
    padding: .65rem 1.3rem;
    border-radius: 10px;
    font-size: .92rem;
    box-shadow: 0 2px 8px -4px rgba(243, 186, 47, .35);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
}

.btn-grad:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px -4px rgba(243, 186, 47, .4);
    filter: brightness(1.06);
    color: #0d0d0d;
}

.btn-grad:disabled,
.btn-grad.is-loading {
    opacity: .6;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-grad-spinner {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    flex-shrink: 0;
    animation: auth-btn-spin .7s linear infinite;
}

.btn-grad.is-loading .btn-grad-spinner {
    display: inline-block;
}

@keyframes auth-btn-spin {
    to { transform: rotate(360deg); }
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1rem 0;
    color: var(--ink-2);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

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

.auth-divider span {
    flex-shrink: 0;
}

.btn-google {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    padding: .65rem 1.3rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    color: #1f1f1f !important;
    font-weight: 600;
    font-size: .92rem;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.btn-google:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, .2);
    box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .45);
    color: #111 !important;
}

.btn-google-icon {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
}

.forgot-link { font-size: .85rem; color: var(--ink-1); }
.forgot-link:hover { color: #fff; }
.forgot-link.is-disabled {
    opacity: .55;
    pointer-events: none;
    cursor: not-allowed;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
    color: var(--ink-1);
    margin-top: 1.1rem;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
}

.back-link.is-disabled,
.forgot-link.is-disabled {
    opacity: .55;
    pointer-events: none;
    cursor: not-allowed;
}

.back-link:hover { color: #fff; }

.success-box,
.error-box {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .9rem 1rem;
    font-size: .85rem;
    display: flex;
    align-items: flex-start;
    gap: .6rem;
}

.success-box {
    background: rgba(243, 186, 47, .08);
    border-color: rgba(243, 186, 47, .28);
    color: var(--ink-1);
    display: none;
}

.success-box.show { display: flex; }
.success-box i { color: var(--blue); margin-top: .15rem; }

.signup-success-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem .5rem .5rem;
}

.signup-success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.15rem;
    background: rgba(243, 186, 47, .12);
    border: 1px solid rgba(243, 186, 47, .28);
}

.signup-success-icon i {
    font-size: 2.35rem;
    line-height: 1;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.signup-success-title {
    display: block;
    color: var(--ink-0);
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: .65rem;
    line-height: 1.4;
}

.signup-success-text {
    margin: 0;
    max-width: 28rem;
    line-height: 1.6;
    color: var(--ink-1);
    font-size: .9rem;
}

.signup-success-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 16rem;
    margin-top: 1.35rem;
    text-decoration: none;
}

.error-box {
    background: rgba(255, 89, 94, .08);
    border-color: rgba(255, 89, 94, .25);
    color: #ffb8ba;
}

.auth-panels { position: relative; }
.panel { transition: opacity .28s ease, transform .28s ease; }

.panel.is-hidden {
    opacity: 0;
    transform: translateY(6px);
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.panel.is-showing {
    opacity: 1;
    transform: translateY(0);
    position: relative;
}

.d-none { display: none !important; }

.turnstile-modal .modal-content {
    background: var(--bg-1);
    border: 1px solid var(--line);
    color: var(--ink-0);
    border-radius: 16px;
}

.turnstile-modal .modal-header {
    border-bottom: 1px solid var(--line);
}

.turnstile-modal .modal-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
}

.turnstile-modal .modal-body {
    padding-top: 1rem;
}

.turnstile-modal-desc {
    color: var(--ink-1);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.turnstile-widget-wrap {
    display: flex;
    justify-content: center;
    min-height: 65px;
}

.turnstile-modal .modal-footer {
    border-top: 1px solid var(--line);
}

.turnstile-modal .btn-light {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--line);
    color: var(--ink-0);
}

.turnstile-modal .btn-light:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--line);
    color: var(--ink-0);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .panel,
    .auth-forms-track,
    .auth-forms-viewport {
        transition: none;
    }
}
