/* User auth — aligned with landing: dark proxy visual + red accent */
:root {
    --auth-accent: #c62828;
    --auth-accent-2: #b71c1c;
    --auth-accent-dim: rgba(198, 40, 40, 0.12);
    --auth-ink: #111827;
    --auth-muted: #6b7280;
    --auth-border: #eceff3;
    --auth-input: #f6f7f9;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
    height: 100%;
    overflow-x: hidden;
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--auth-ink);
    background: #fff;
}

.auth-wrap {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background: #fff;
}

/* ── Visual panel ── */
.auth-visual {
    flex: 1 1 54%;
    min-width: 0;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: #0a0a0c;
}
.auth-visual-media,
.auth-visual-overlay,
.auth-visual-grid {
    position: absolute;
    inset: 0;
}
.auth-visual-media {
    background-color: #0a0a0c;
    background-position: center 42%;
    background-size: cover;
    background-repeat: no-repeat;
    transform: scale(1.05);
    animation: auth-kenburns 18s ease-out forwards;
}
.auth-visual.is-login .auth-visual-media {
    background-image: url("/images/auth/login.png");
}
.auth-visual.is-register .auth-visual-media {
    background-image: url("/images/auth/register.png");
}
.auth-visual-overlay {
    background:
        linear-gradient(180deg, rgba(10, 10, 12, 0.18) 0%, rgba(10, 10, 12, 0.52) 46%, rgba(10, 10, 12, 0.92) 100%),
        linear-gradient(90deg, rgba(198, 40, 40, 0.22), transparent 58%);
    pointer-events: none;
}
.auth-visual-grid {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at 40% 60%, #000 20%, transparent 72%);
    pointer-events: none;
    opacity: 0.7;
}
.auth-visual-inner {
    position: relative;
    z-index: 2;
    width: min(520px, calc(100% - 64px));
    margin: 0 40px 44px;
    color: #fff;
}
.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #ff8a80;
    margin-bottom: 12px;
}
.auth-kicker::before {
    content: "";
    width: 18px;
    height: 2px;
    background: #ff8a80;
}
.auth-visual-title {
    font-size: clamp(1.7rem, 2.6vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.15;
    margin: 0 0 10px;
    text-wrap: balance;
}
.auth-visual-sub {
    margin: 0 0 22px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.98rem;
    line-height: 1.65;
    max-width: 440px;
}
.auth-ip-card {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    padding: 16px 18px 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    margin-bottom: 22px;
}
.auth-ip-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.auth-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #ff8a80;
}
.auth-live i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff5252;
    box-shadow: 0 0 0 4px rgba(255, 82, 82, 0.22);
}
.auth-ip-tag {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}
.auth-ip {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin-bottom: 4px;
}
.auth-ip-ipv6 {
    font-size: .92rem;
    font-weight: 700;
    letter-spacing: 0;
    opacity: .92;
    margin-bottom: 8px;
}
.auth-ip-ipv6 small {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255,255,255,.16);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.auth-ip-meta {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.86rem;
    margin-bottom: 12px;
}
.auth-ip-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.auth-chip {
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    padding: 10px 12px;
}
.auth-chip small {
    display: block;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.7rem;
    margin-bottom: 3px;
}
.auth-chip b {
    font-size: 0.86rem;
    color: #fff;
    font-weight: 700;
}
.auth-visual-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 22px 28px;
}
.auth-visual-stats b {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
}
.auth-visual-stats span {
    display: block;
    margin-top: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.62);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

@keyframes auth-kenburns {
    from { transform: scale(1.05); }
    to { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-visual-media { animation: none; transform: none; }
}

/* ── Form panel ── */
.auth-right {
    width: 540px;
    min-width: 480px;
    min-height: 100vh;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 52px;
    overflow-y: auto;
    flex: 0 0 auto;
    box-shadow: -16px 0 40px rgba(17, 24, 39, 0.05);
}
.auth-right.is-packed {
    justify-content: flex-start;
    padding-top: 28px;
    padding-bottom: 36px;
}
.auth-form-inner { width: 100%; max-width: 420px; }
.auth-form-inner.is-wide { max-width: 460px; }
.auth-form-inner.is-center { text-align: center; }

.auth-logo { margin-bottom: 28px; text-align: center; }
.auth-logo.is-compact { margin-bottom: 14px; }
.auth-logo img { max-height: 56px; max-width: 200px; object-fit: contain; }
.auth-logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--auth-accent);
}
.auth-logo-text i { color: var(--auth-accent); }

.auth-title {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--auth-ink);
    margin: 0 0 8px;
}
.auth-title.is-compact { font-size: 1.35rem; margin-bottom: 4px; }
.auth-subtitle {
    font-size: 0.9rem;
    color: var(--auth-muted);
    margin: 0 0 24px;
    line-height: 1.65;
}
.auth-subtitle.is-compact { margin-bottom: 14px; }
.auth-label {
    font-size: 0.86rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    display: block;
}
.auth-input,
.auth-input-code {
    width: 100%;
    background: var(--auth-input);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.92rem;
    color: var(--auth-ink);
    outline: none;
    transition: box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.auth-input:focus,
.auth-input-code:focus {
    background: #fff;
    border-color: #f0c0c0;
    box-shadow: 0 0 0 3px var(--auth-accent-dim);
}
.auth-input-code {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.6rem;
    padding: 14px 16px;
}

.pw-wrap { position: relative; }
.pw-wrap .auth-input { padding-right: 44px; }
.pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-size: 1rem;
}
.pw-toggle:hover { color: #374151; }

.btn-auth-primary {
    width: 100%;
    background: var(--auth-accent);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 13px 18px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s ease, transform 0.15s ease;
}
.btn-auth-primary:hover {
    background: var(--auth-accent-2);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}
.btn-auth-primary:focus-visible {
    outline: 2px solid var(--auth-accent);
    outline-offset: 3px;
}

.btn-auth-google {
    width: 100%;
    background: #fff;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.btn-auth-google:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
    text-decoration: none;
}

.auth-link { font-size: 0.88rem; color: var(--auth-muted); }
.auth-link a {
    color: var(--auth-accent);
    font-weight: 700;
    text-decoration: none;
}
.auth-link a:hover { text-decoration: underline; }

.tos-text { font-size: 0.82rem; color: var(--auth-muted); margin-bottom: 14px; }
.tos-text a { color: var(--auth-accent); font-weight: 700; text-decoration: none; }
.tos-text a:hover { text-decoration: underline; }

.remember-hint { font-size: 0.8rem; color: var(--auth-muted); }
.validation-error { font-size: 0.8rem; color: #dc2626; margin-top: 4px; }
.alert-auth {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #dc2626;
    margin-bottom: 16px;
}
.alert-success-auth {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #059669;
    margin-bottom: 16px;
}

.pw-requirements {
    background: #f9fafb;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    padding: 10px 14px;
    margin-top: 6px;
}
.pw-req-title { font-size: 0.85rem; font-weight: 700; color: #374151; margin-bottom: 6px; }
.pw-req-item {
    font-size: 0.82rem;
    color: #6b7280;
    padding: 2px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pw-req-item i { font-size: 0.7rem; }
.pw-req-item.pass { color: #059669; }
.pw-req-item.pass i::before { content: "\f26a"; }
.pw-req-badge {
    background: #fef2f2;
    color: #dc2626;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    font-style: italic;
}
.pw-req-item.pass .pw-req-badge { background: #ecfdf5; color: #059669; }

.terms-modal-body { color: #374151; font-size: 0.92rem; line-height: 1.75; }
.terms-modal-body h2,
.terms-modal-body h3,
.terms-modal-body h4 { color: #111827; font-weight: 800; margin-top: 1rem; margin-bottom: 0.55rem; }
.terms-modal-body h2:first-child,
.terms-modal-body h3:first-child,
.terms-modal-body h4:first-child { margin-top: 0; }
.terms-modal-body ul,
.terms-modal-body ol { padding-left: 1.25rem; }
.terms-modal-body .term-section + .term-section { margin-top: 0.85rem; }

.confirm-icon {
    width: 84px;
    height: 84px;
    margin: 0 auto 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ecfdf5, #dcfce7);
    color: #16a34a;
    font-size: 2.25rem;
}
.timer-wrap { font-size: 0.8rem; color: #9ca3af; text-align: center; margin-top: 6px; }

.form-check-input:checked {
    background-color: var(--auth-accent);
    border-color: var(--auth-accent);
}
.form-check-input:focus {
    border-color: #f0c0c0;
    box-shadow: 0 0 0 3px var(--auth-accent-dim);
}

@media (max-width: 991px) {
    .auth-visual { display: none; }
    .auth-right {
        width: 100%;
        min-width: 0;
        padding: 40px 24px;
        box-shadow: none;
    }
    .auth-form-inner,
    .auth-form-inner.is-wide { max-width: 100%; }
}

@media (max-height: 760px) {
    .auth-visual-stats { display: none; }
    .auth-visual-inner { margin-bottom: 28px; }
}
