/* ──────────────────────────────────────────────────────────────────
   PulseLens · auth pages.
   Shared by login, register, forgot-password, reset-password, verify-email-sent.
   Split-layout: brand слева, форма справа.
   Источник — Claude Designer handoff (PulseLens auth redesign).
   ────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; }

:root {
    --bg-0: #0a0a0b;
    --bg-1: #131316;
    --bg-2: #1c1c20;
    --bg-3: #27272a;
    --border-1: #27272a;
    --border-2: #3f3f46;
    --fg-0: #fafaf9;
    --fg-1: #e4e4e7;
    --fg-2: #a1a1aa;
    --fg-3: #71717a;
    --fg-4: #52525b;

    --accent:      oklch(0.65 0.21 275);
    --accent-soft: oklch(0.65 0.21 275 / 0.16);
    --accent-bg:   oklch(0.65 0.21 275 / 0.10);
    --accent-h:    oklch(0.72 0.20 275);

    --good:    oklch(0.55 0.16 152);
    --good-bg: oklch(0.55 0.16 152 / 0.10);
    --warn:    oklch(0.70 0.16 68);
    --warn-bg: oklch(0.70 0.16 68 / 0.12);
    --bad:     oklch(0.58 0.22 28);
    --bad-bg:  oklch(0.58 0.22 28 / 0.10);

    --font-sans: 'Geist', -apple-system, system-ui, sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, monospace;
    --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
}

html, body {
    height: 100%;
    font-family: var(--font-sans);
    background: var(--bg-0);
    color: var(--fg-1);
    -webkit-font-smoothing: antialiased;
}

/* Page fade transitions */
body { animation: page-in 0.3s ease both; }
@keyframes page-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-out { animation: page-out 0.2s ease forwards !important; }
@keyframes page-out {
    to { opacity: 0; transform: translateY(-6px); }
}

/* ── Layout ─────────────────────────────────────────── */
.auth-wrap {
    display: grid;
    grid-template-columns: 1fr 440px;
    min-height: 100vh;
}

/* ── Left brand panel ───────────────────────────────── */
.auth-brand {
    display: flex; flex-direction: column;
    padding: 40px 56px;
    background: var(--bg-0);
    border-right: 1px solid var(--border-1);
    position: relative; overflow: hidden;
}
.auth-brand::before {
    content: '';
    position: absolute; top: -200px; left: -100px;
    width: 600px; height: 600px;
    background: radial-gradient(circle, oklch(0.65 0.21 275 / 0.10) 0%, transparent 65%);
    pointer-events: none;
}

.auth-logo {
    display: inline-flex; align-items: center; gap: 9px;
    margin-bottom: auto; position: relative; z-index: 1;
}
.auth-logo-name {
    font-size: 15px; font-weight: 700;
    letter-spacing: -0.01em; color: var(--fg-0);
}

.auth-brand-body {
    flex: 1; display: flex; flex-direction: column;
    justify-content: center;
    position: relative; z-index: 1;
    padding: 48px 0 32px;
}

/* Particle */
.auth-particle {
    position: relative; width: 80px; height: 80px;
    margin-bottom: 32px;
}
.auth-particle::before {
    content: '';
    position: absolute; inset: -20px; border-radius: 50%;
    background: radial-gradient(circle,
        oklch(0.65 0.21 275 / 0.16) 0%, transparent 68%);
    animation: ap-aura 3.4s ease-in-out infinite;
}
.ap-ring {
    position: absolute; top: 50%; left: 50%;
    width: 30px; height: 30px; margin: -15px 0 0 -15px;
    border-radius: 50%;
    border: 1px solid oklch(0.65 0.21 275 / 0.55);
    animation: ap-sonar 3.8s cubic-bezier(0,0,0.2,1) infinite;
}
.ap-ring-2 { animation-delay: 1.9s; }
.ap-core {
    position: absolute; top: 50%; left: 50%;
    width: 16px; height: 16px; margin: -8px 0 0 -8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px oklch(0.65 0.21 275 / 0.7),
                0 0 36px oklch(0.65 0.21 275 / 0.3);
    animation: ap-beat 2.2s ease-in-out infinite;
}
@keyframes ap-aura  { 0%,100%{transform:scale(1);opacity:.8} 50%{transform:scale(1.2);opacity:1} }
@keyframes ap-sonar { 0%{transform:scale(1);opacity:.6} 80%{opacity:0} 100%{transform:scale(5);opacity:0} }
@keyframes ap-beat  { 0%,100%{transform:scale(1)} 50%{transform:scale(1.15)} }

.auth-brand-h {
    font-size: clamp(26px, 3vw, 40px);
    font-weight: 650; letter-spacing: -0.025em;
    color: var(--fg-0); line-height: 1.1;
    margin-bottom: 12px; text-wrap: balance;
}
.auth-brand-h em {
    font-style: normal;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-h) 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.auth-brand-sub {
    font-size: 14px; color: var(--fg-3); line-height: 1.6;
    margin-bottom: 36px;
}

/* Login: mini AI exchange */
.auth-ai-card {
    background: var(--bg-2); border: 1px solid var(--border-1);
    border-radius: var(--r-lg); overflow: hidden;
    max-width: 440px;
}
.auth-ai-head {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 12px; border-bottom: 1px solid var(--border-1);
    background: var(--bg-1);
}
.auth-ai-dots { display: flex; gap: 5px; }
.auth-ai-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bg-3); }
.auth-ai-ts {
    font-family: var(--font-mono); font-size: 9px;
    color: var(--fg-4); letter-spacing: .07em; text-transform: uppercase;
    margin-left: 4px;
}
.auth-ai-mini-particle {
    margin-left: auto; position: relative; width: 14px; height: 14px;
}
.auth-ai-mini-particle::before, .auth-ai-mini-particle::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    border: 1px solid var(--accent);
    animation: ap-sonar 2.6s cubic-bezier(0,0,0.2,1) infinite;
}
.auth-ai-mini-particle::after { animation-delay: 1.3s; }
.auth-ai-mini-core {
    position: absolute; top: 50%; left: 50%;
    width: 6px; height: 6px; margin: -3px 0 0 -3px;
    border-radius: 50%; background: var(--accent);
    box-shadow: 0 0 5px oklch(0.65 0.21 275 / .7);
    animation: ap-beat 2.2s ease-in-out infinite;
}
.auth-ai-msgs { padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.auth-msg-user {
    align-self: flex-end;
    background: var(--accent-bg);
    border: 1px solid oklch(0.65 0.21 275 / 0.18);
    border-radius: 8px 8px 2px 8px;
    padding: 7px 11px; font-size: 13px;
}
.auth-msg-ai {
    align-self: flex-start; display: flex; align-items: flex-start; gap: 8px;
    border: 1px solid var(--border-1); border-radius: 2px 8px 8px 8px;
    padding: 8px 12px; font-size: 13px; color: var(--fg-2);
    max-width: 100%;
}
.auth-msg-ai.warn { border-left: 2px solid var(--warn); }
.auth-msg-ai.ok   { border-left: 2px solid var(--good); }
.sig {
    flex-shrink: 0; font-family: var(--font-mono); font-size: 9px;
    text-transform: uppercase; letter-spacing: .04em; font-weight: 600;
    padding: 2px 6px; border-radius: 4px;
}
.sig.warn { background: var(--warn-bg); color: var(--warn); }
.sig.ok   { background: var(--good-bg); color: var(--good); }
.auth-msg-ai b { color: var(--fg-0); font-weight: 600; }

/* Register: what you get list */
.auth-get-list {
    display: flex; flex-direction: column; gap: 12px;
    max-width: 440px;
}
.auth-get-item {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 13px; color: var(--fg-2); line-height: 1.5;
}
.auth-get-icon {
    flex-shrink: 0; width: 22px; height: 22px;
    border-radius: 6px; margin-top: 1px;
    display: grid; place-items: center;
}
.auth-get-icon.v  { background: var(--accent-bg); color: var(--accent); }
.auth-get-icon.g  { background: var(--good-bg);   color: var(--good); }
.auth-get-icon.w  { background: var(--warn-bg);   color: var(--warn); }
.auth-get-item b  { color: var(--fg-0); font-weight: 600; }

/* Reset / forgot: security badges */
.auth-badges { display: flex; flex-direction: column; gap: 10px; }
.auth-badge {
    display: flex; align-items: center; gap: 10px;
    font-size: 13px; color: var(--fg-2);
}
.auth-badge-icon {
    width: 22px; height: 22px; border-radius: 6px;
    display: grid; place-items: center; flex-shrink: 0;
}
.auth-badge-icon.v { background: var(--accent-bg); color: var(--accent); }
.auth-badge b { color: var(--fg-0); font-weight: 600; }

.auth-brand-footer {
    font-family: var(--font-mono); font-size: 9px;
    color: var(--fg-4); letter-spacing: .07em; text-transform: uppercase;
    display: flex; align-items: center; gap: 14px;
    position: relative; z-index: 1;
}
.auth-brand-footer::before {
    content: ''; width: 18px; height: 1px; background: var(--border-2);
}

/* ── Right form panel ───────────────────────────────── */
.auth-form-panel {
    display: flex; flex-direction: column;
    background: var(--bg-1);
    padding: 40px 40px;
}
.auth-form-top {
    display: flex; justify-content: flex-end; align-items: center;
    margin-bottom: auto;
}
.auth-lang {
    font-family: var(--font-mono); font-size: 10px;
    letter-spacing: .06em; color: var(--fg-3);
    padding: 5px 10px; border: 1px solid var(--border-1);
    border-radius: var(--r-sm); transition: color .12s, border-color .12s;
}
.auth-lang:hover { color: var(--accent); border-color: var(--accent); }

.auth-form-body {
    flex: 1; display: flex; flex-direction: column;
    justify-content: center; padding: 40px 0;
}
.auth-form-h {
    font-size: 24px; font-weight: 650;
    letter-spacing: -0.02em; color: var(--fg-0);
    margin-bottom: 6px;
}
.auth-form-sub {
    font-size: 13px; color: var(--fg-3);
    margin-bottom: 32px; line-height: 1.5;
}

/* Alerts */
.auth-alert {
    padding: 10px 14px; border-radius: var(--r-sm);
    font-size: 13px; margin-bottom: 16px; line-height: 1.5;
}
.auth-alert.error {
    background: var(--bad-bg);
    border: 1px solid oklch(0.58 0.22 28 / 0.25);
    color: var(--bad);
}
.auth-alert.warn {
    background: var(--warn-bg);
    border: 1px solid oklch(0.70 0.16 68 / 0.25);
    color: var(--warn);
}
.auth-alert.ok {
    background: var(--good-bg);
    border: 1px solid oklch(0.55 0.16 152 / 0.25);
    color: var(--good);
}
.auth-alert a { color: inherit; text-decoration: underline; }
.auth-alert strong { color: inherit; }

/* Form fields */
.auth-field { margin-bottom: 14px; }
.auth-label {
    display: flex; justify-content: space-between; align-items: center;
    font-family: var(--font-mono); font-size: 10px;
    letter-spacing: .07em; text-transform: uppercase;
    color: var(--fg-3); margin-bottom: 6px;
}
.auth-label a {
    font-size: 10px; color: var(--accent);
    letter-spacing: .04em; text-transform: lowercase;
    transition: opacity .12s;
}
.auth-label a:hover { opacity: .75; }
.auth-input-wrap { position: relative; }
.auth-input {
    width: 100%; height: 40px;
    background: var(--bg-2); border: 1px solid var(--border-1);
    border-radius: var(--r-sm); color: var(--fg-0);
    font-size: 14px; padding: 0 12px;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.auth-input.has-toggle { padding-right: 36px; }
.auth-input::placeholder { color: var(--fg-4); }
.auth-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px oklch(0.65 0.21 275 / 0.12);
}
.auth-input-eye {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    color: var(--fg-4); cursor: pointer; width: 18px; height: 18px;
    display: grid; place-items: center;
    background: none; border: none; padding: 0;
}
.auth-input-eye:hover { color: var(--fg-2); }

/* Password strength */
.auth-strength { display: flex; gap: 3px; margin-top: 6px; }
.auth-strength-bar {
    flex: 1; height: 2px; border-radius: 2px;
    background: var(--border-1);
    transition: background .3s;
}
.auth-strength-bar.weak   { background: var(--bad); }
.auth-strength-bar.medium { background: var(--warn); }
.auth-strength-bar.strong { background: var(--good); }

/* Remember */
.auth-remember {
    display: flex; align-items: center; gap: 9px;
    font-size: 13px; color: var(--fg-2);
    margin-bottom: 20px; cursor: pointer;
}
.auth-remember input[type="checkbox"] {
    width: 15px; height: 15px; accent-color: var(--accent);
}

/* Submit button */
.auth-submit {
    width: 100%; height: 42px;
    background: var(--accent); color: #fff;
    font-family: var(--font-sans); font-size: 14px; font-weight: 500;
    border-radius: var(--r-sm);
    transition: background .12s;
    cursor: pointer; border: none;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.auth-submit:hover { background: var(--accent-h); }

/* Divider */
.auth-or {
    display: flex; align-items: center; gap: 12px;
    margin: 18px 0; font-size: 12px; color: var(--fg-4);
}
.auth-or::before, .auth-or::after {
    content: ''; flex: 1; height: 1px; background: var(--border-1);
}

/* Secondary button */
.auth-secondary {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 42px;
    background: transparent; color: var(--fg-1);
    font-family: var(--font-sans); font-size: 14px; font-weight: 500;
    border: 1px solid var(--border-2); border-radius: var(--r-sm);
    transition: background .12s, border-color .12s;
    cursor: pointer; text-decoration: none;
}
.auth-secondary:hover { background: var(--bg-2); border-color: var(--border-2); }

/* Links below form */
.auth-links {
    text-align: center; margin-top: 20px;
    font-size: 13px; color: var(--fg-3);
}
.auth-links a {
    color: var(--accent); transition: opacity .12s;
}
.auth-links a:hover { opacity: .75; }
.auth-links-row {
    display: flex; justify-content: center; gap: 12px;
}
.auth-links-sep { color: var(--fg-4); }

/* Form footer */
.auth-form-footer {
    font-family: var(--font-mono); font-size: 9px;
    color: var(--fg-4); letter-spacing: .06em;
    display: flex; justify-content: space-between;
    margin-top: auto; padding-top: 20px;
}
.auth-form-footer a { transition: color .12s; }
.auth-form-footer a:hover { color: var(--fg-2); }

/* ── Verify-email-sent specials ────────────────────── */
.verify-icon {
    width: 64px; height: 64px; border-radius: 18px;
    background: var(--accent-bg);
    border: 1px solid color-mix(in oklch, var(--accent) 22%, transparent);
    display: grid; place-items: center; color: var(--accent);
    margin-bottom: 28px;
}
@keyframes envelope-in {
    0%   { transform: translateY(8px) scale(0.85); opacity: 0; }
    60%  { transform: translateY(-3px) scale(1.05); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}
.verify-icon svg {
    animation: envelope-in 0.6s 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
    opacity: 0;
}

.verify-tip {
    padding: 11px 14px; border-radius: var(--r-sm);
    background: var(--warn-bg);
    border: 1px solid oklch(0.70 0.16 68 / 0.22);
    font-size: 13px; color: var(--warn); margin-bottom: 24px;
    display: flex; gap: 9px; align-items: flex-start; line-height: 1.5;
}
.verify-tip svg { flex-shrink: 0; margin-top: 1px; }

.auth-btn-primary {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; height: 42px;
    background: var(--accent); color: #fff;
    font-family: var(--font-sans); font-size: 14px; font-weight: 500;
    border-radius: var(--r-sm); transition: background .12s;
    cursor: pointer; border: none; text-decoration: none;
    margin-bottom: 10px;
}
.auth-btn-primary:hover { background: var(--accent-h); }
.auth-btn-secondary {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 42px;
    background: transparent; color: var(--fg-2);
    font-family: var(--font-sans); font-size: 14px; font-weight: 500;
    border-radius: var(--r-sm); border: 1px solid var(--border-2);
    transition: background .12s; cursor: pointer; text-decoration: none;
}
.auth-btn-secondary:hover { background: var(--bg-2); }

/* ── Stagger-in animations ──────────────────────────── */
.auth-brand-body > * { opacity: 0; animation: auth-in .5s ease both; }
.auth-brand-body > :nth-child(1) { animation-delay: .1s; }
.auth-brand-body > :nth-child(2) { animation-delay: .2s; }
.auth-brand-body > :nth-child(3) { animation-delay: .3s; }
.auth-brand-body > :nth-child(4) { animation-delay: .38s; }
.auth-form-body > * { opacity: 0; animation: auth-in .5s ease both; }
.auth-form-body > :nth-child(1) { animation-delay: .15s; }
.auth-form-body > :nth-child(2) { animation-delay: .22s; }
.auth-form-body > :nth-child(3) { animation-delay: .28s; }
.auth-form-body > :nth-child(4) { animation-delay: .34s; }
.auth-form-body > :nth-child(5) { animation-delay: .38s; }
.auth-form-body > :nth-child(6) { animation-delay: .42s; }
.auth-form-body > :nth-child(7) { animation-delay: .46s; }
.auth-form-body > :nth-child(8) { animation-delay: .50s; }
.auth-form-body > :nth-child(9) { animation-delay: .54s; }
@keyframes auth-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Mobile-only logo (replaces hidden brand panel) */
.auth-mobile-logo {
    display: none;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}
.auth-mobile-logo .auth-logo-name {
    font-size: 14px; font-weight: 700;
    letter-spacing: -0.01em; color: var(--fg-0);
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 820px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .auth-form-panel { min-height: 100vh; padding: 32px 24px; }
    .auth-form-top { justify-content: space-between; }
    .auth-mobile-logo { display: inline-flex; }
    .auth-form-body { padding: 24px 0; }
}
