/* ════════════════════════════════════════════════
   Zakovat — Login (yangi modern dizayn)
   Markaziy kartochka + animatsiyali gradient orblar
   ════════════════════════════════════════════════ */

/* ─── STAGE (full screen container) ──────────── */
.login-stage {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: var(--bg);
    overflow: hidden;
}

/* Subtle grid pattern */
.login-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--line-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.25;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    pointer-events: none;
}

/* ─── ORBS — gradient blob'lar (performant) ─── */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(55px);
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
    transform: translateZ(0);
    animation: orbFloat 18s ease-in-out infinite;
}

.orb-1 {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, var(--accent), transparent 68%);
    top: -110px;
    left: -110px;
    animation-delay: 0s;
}

.orb-2 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, #4ec9e6, transparent 68%);
    bottom: -90px;
    right: -90px;
    opacity: 0.32;
    animation-delay: -6s;
}

.orb-3 {
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, #ff6bd6, transparent 68%);
    top: 42%;
    right: 18%;
    opacity: 0.18;
    animation-delay: -11s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50%      { transform: translate3d(30px, -24px, 0); }
}

/* Light mode — orblar yumshoqroq */
[data-theme="light"] .orb { opacity: 0.26; }
[data-theme="light"] .orb-2 { opacity: 0.18; }
[data-theme="light"] .orb-3 { opacity: 0.12; }

/* Mobil — orblarni soddalashtiramiz (lag bo'lmasin) */
@media (max-width: 640px) {
    .orb { animation: none; filter: blur(45px); opacity: 0.35; }
    .orb-3 { display: none; }
}

/* ─── THEME TOGGLE (top-right corner) ────────── */
.login-theme-toggle {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 10;
}

/* ─── KARTOCHKA ───────────────────────────────── */
.login-card {
    position: relative;
    z-index: 5;
    width: 100%;
    max-width: 420px;
    background: rgba(18, 20, 23, 0.92);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 36px 30px;
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.04) inset;
    animation: cardIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Desktopda nozik glass effekt (mobil'da yo'q — lag bo'lmasin) */
@media (min-width: 641px) {
    .login-card {
        background: rgba(20, 22, 24, 0.78);
        backdrop-filter: blur(16px) saturate(120%);
        -webkit-backdrop-filter: blur(16px) saturate(120%);
    }
}

[data-theme="light"] .login-card {
    background: rgba(251, 249, 244, 0.95);
    box-shadow:
        0 24px 70px rgba(28, 26, 21, 0.16),
        0 1px 0 rgba(255, 255, 255, 0.5) inset;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme]) .login-card {
        background: rgba(251, 249, 244, 0.95);
    }
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── BRAND ─────────────────────────────────── */
.brand {
    text-align: center;
    margin-bottom: 26px;
}

.brand-mark {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, var(--accent), #ff8c00);
    border-radius: 16px;
    box-shadow:
        0 8px 24px rgba(245, 185, 66, 0.35),
        0 0 0 1px rgba(245, 185, 66, 0.3) inset;
}

.brand-z {
    font-family: 'JetBrains Mono', monospace;
    font-size: 32px;
    font-weight: 800;
    color: #1a1300;
    line-height: 1;
    z-index: 2;
}

/* Spark — pulsatsiyalanuvchi nuqta */
.brand-spark {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--bg);
    animation: sparkPulse 2.2s infinite;
}

@keyframes sparkPulse {
    0%, 100% { box-shadow: 0 0 0 4px var(--bg), 0 0 0 0 rgba(245, 185, 66, 0.6); }
    50%      { box-shadow: 0 0 0 4px var(--bg), 0 0 0 10px rgba(245, 185, 66, 0); }
}

.brand-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--text);
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
}

.brand-motto {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.brand-motto .dot { color: var(--text-mute); }
.brand-motto .amber { color: var(--accent); font-weight: 600; }

/* ─── TAB SWITCHER (sliding underline) ─────── */
.tab-switcher {
    position: relative;
    display: flex;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 11px 8px;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
}

.tab-btn:hover:not(.active) { color: var(--text); }
.tab-btn.active { color: var(--accent); }

.tab-indicator {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 50%;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* tab-indicator's transform is set by JS (switchMode) */

/* ─── FORM FIELD ───────────────────────────── */
.auth-form {
    display: none;
    flex-direction: column;
    gap: 14px;
}
.auth-form.active { display: flex; animation: fadeUp 0.3s ease; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ff { display: flex; flex-direction: column; gap: 6px; }

.ff label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.01em;
    font-family: inherit;
    text-transform: none;
}

.ff input {
    height: 44px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    padding: 0 14px;
    outline: none;
    transition: all 0.2s;
}

[data-theme="light"] .ff input { background: rgba(28, 26, 21, 0.03); }

.ff input::placeholder { color: var(--text-mute); }

.ff input:hover { border-color: var(--text-mute); }

.ff input:focus {
    border-color: var(--accent);
    background: rgba(245, 185, 66, 0.04);
    box-shadow: 0 0 0 3px rgba(245, 185, 66, 0.15);
}

.ff-hint {
    font-size: 11px;
    color: var(--text-mute);
    padding-left: 2px;
}

.ff-with-action {
    position: relative;
}

.ff-with-action input { width: 100%; padding-right: 44px; }

.ff-action {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.ff-action:hover { color: var(--accent); background: rgba(245, 185, 66, 0.08); }

.eye { font-size: 16px; }

/* ─── ROW HELPERS (remember + forgot) ──────── */
.row-helpers {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 0 6px;
    font-size: 12px;
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: var(--text-dim);
}

.remember input { display: none; }

.checkbox-mark {
    width: 16px;
    height: 16px;
    border: 1.5px solid var(--line);
    border-radius: 4px;
    transition: all 0.15s;
    flex-shrink: 0;
    position: relative;
}

.remember input:checked + .checkbox-mark {
    background: var(--accent);
    border-color: var(--accent);
}

.remember input:checked + .checkbox-mark::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid var(--on-accent);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.link-muted {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.15s;
}

.link-muted:hover { color: var(--accent); }

/* ─── CTA tugma (gradient + arrow) ─────────── */
.cta {
    margin-top: 4px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent), #ff8c00);
    color: #1a1300;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow:
        0 8px 24px rgba(245, 185, 66, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.cta:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow:
        0 10px 28px rgba(245, 185, 66, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.cta:active:not(:disabled) { transform: translateY(0); }

.cta:disabled {
    background: var(--bg-card);
    color: var(--text-mute);
    box-shadow: none;
    cursor: not-allowed;
}

.cta-arrow {
    width: 18px;
    height: 18px;
    transition: transform 0.2s;
}

.cta:hover:not(:disabled) .cta-arrow { transform: translateX(3px); }

/* ─── ALT (demo) tugmalar ──────────────────── */
.alt-row {
    margin-top: 6px;
    display: flex;
    gap: 8px;
}

.alt-btn {
    flex: 1;
    height: 38px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.alt-btn:hover {
    border-color: var(--text-mute);
    color: var(--text);
}

.alt-btn.alt-accent {
    border-color: rgba(245, 185, 66, 0.4);
    color: var(--accent);
}

.alt-btn.alt-accent:hover {
    border-color: var(--accent);
    background: rgba(245, 185, 66, 0.08);
}

/* ─── Google Sign-In ────────────────────────── */
.oauth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
    color: var(--text-mute);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

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

.google-btn-wrap {
    display: flex;
    justify-content: center;
}

/* ─── Card footer ──────────────────────────── */
.card-footer {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
    text-align: center;
    font-size: 11px;
    color: var(--text-mute);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dot-sep { color: var(--text-mute); }

/* ─── Strength (register) ──────────────────── */
.strength {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--line);
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    background: var(--neg);
    border-radius: 2px;
    transition: width 0.3s, background 0.3s;
}

.strength span {
    font-size: 10px;
    color: var(--text-mute);
    min-width: 72px;
    text-align: right;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

/* Tablet (≤640px) */
@media (max-width: 640px) {
    .login-card { padding: 30px 24px; max-width: 100%; }
    .brand-title { font-size: 28px; letter-spacing: 0.16em; }
    .brand-mark { width: 56px; height: 56px; }
    .brand-z { font-size: 28px; }
    .orb-1 { width: 360px; height: 360px; }
    .orb-2 { width: 300px; height: 300px; }
    .orb-3 { display: none; }
}

/* Mobile (≤480px) */
@media (max-width: 480px) {
    .login-stage { padding: 16px 12px; }
    .login-card {
        padding: 26px 20px;
        border-radius: 14px;
    }
    .brand { margin-bottom: 20px; }
    .brand-mark { width: 52px; height: 52px; margin-bottom: 12px; border-radius: 14px; }
    .brand-z { font-size: 26px; }
    .brand-title { font-size: 24px; letter-spacing: 0.14em; }
    .brand-motto { font-size: 11px; }
    .tab-switcher { margin-bottom: 18px; }
    .tab-btn { font-size: 12px; padding: 10px 6px; }
    .ff input { height: 46px; }
    .cta { height: 48px; }
    .alt-row { flex-direction: column; gap: 6px; }
    .alt-btn { flex: 1 1 100%; height: 40px; }
    .card-footer { font-size: 10px; }
    .login-theme-toggle { top: 14px; right: 14px; width: 36px; height: 36px; }
}

/* Juda kichik (≤360px) */
@media (max-width: 360px) {
    .login-card { padding: 22px 16px; }
    .brand-title { font-size: 22px; }
}

/* Landscape mobil (kichik balandlik) */
@media (max-height: 620px) and (orientation: landscape) {
    .login-stage { padding: 14px; align-items: flex-start; }
    .login-card { padding: 20px; max-width: 460px; }
    .brand { margin-bottom: 16px; }
    .brand-mark { display: none; }
    .brand-title { font-size: 20px; }
    .brand-motto { font-size: 10px; }
    .tab-switcher { margin-bottom: 14px; }
    .auth-form { gap: 10px; }
    .ff input { height: 38px; }
    .cta { height: 42px; }
}

/* Reduce-motion */
@media (prefers-reduced-motion: reduce) {
    .orb { animation: none; }
    .brand-spark { animation: none; }
    .login-card, .auth-form { animation: none; }
}
