/* =========================================================
   Kiriw betleri (oqıwshı hám muǵalim) — aq / qara rejim
   ========================================================= */
:root, html[data-theme="light"] {
    --bg: #f3f5fb;
    --surface: #ffffff;
    --text: #0d1326;
    --muted: #5d6680;
    --line: #dfe4f0;
    --field: #f7f8fc;
    --field-line: #d5dbea;
    --shadow: 0 30px 70px -30px rgba(23, 32, 74, .28);
    --err-bg: #fff1f2; --err-tx: #be123c; --err-ln: #fecdd3;
}
html[data-theme="dark"] {
    --bg: #070a14;
    --surface: #0f1424;
    --text: #eef1fb;
    --muted: #8f99b5;
    --line: #1f2740;
    --field: #0b1020;
    --field-line: #263051;
    --shadow: 0 30px 80px -30px rgba(0, 0, 0, .7);
    --err-bg: rgba(244, 63, 94, .12); --err-tx: #fda4af; --err-ln: rgba(244, 63, 94, .3);
}
/* Reń ayırmashılıǵı: oqıwshı — kók-fiolet, muǵalim — jasıl */
.auth-student { --a1: #4f46e5; --a2: #7c3aed; --a3: #06b6d4; --ring: rgba(99, 102, 241, .22);
    --panel: linear-gradient(150deg, #1e1b4b 0%, #3b1d8f 45%, #0e7490 120%); }
.auth-admin   { --a1: #059669; --a2: #0d9488; --a3: #84cc16; --ring: rgba(16, 185, 129, .22);
    --panel: linear-gradient(150deg, #022c22 0%, #065f46 50%, #0f766e 110%); }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body.auth2 {
    min-height: 100vh; min-height: 100dvh;
    font: 15px/1.5 Inter, system-ui, "Segoe UI", Arial, sans-serif;
    color: var(--text); background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--a1); }
html[data-theme="dark"] a { color: #a5b4fc; }
html[data-theme="dark"] .auth-admin a { color: #6ee7b7; }

.auth-wrap {
    min-height: 100vh; min-height: 100dvh;
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 0; padding: 16px;
}

/* ---------- Shep panel (kórgizbe) ---------- */
.show {
    position: relative; overflow: hidden; border-radius: 28px;
    background: var(--panel); color: #fff;
    padding: 40px 44px; display: flex; flex-direction: column;
    isolation: isolate;
}
.show::before { /* tor */
    content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
    background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at 30% 20%, #000 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 30% 20%, #000 0%, transparent 75%);
}
.show .orb { position: absolute; z-index: -1; border-radius: 50%; filter: blur(60px); opacity: .55; }
.show .orb.o1 { width: 340px; height: 340px; background: var(--a3); right: -90px; top: -80px; animation: drift 14s ease-in-out infinite alternate; }
.show .orb.o2 { width: 300px; height: 300px; background: var(--a2); left: -100px; bottom: -120px; animation: drift 18s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(-40px, 40px) scale(1.12); } }

.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand .logo {
    width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
    background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(8px);
}
.brand .logo svg { width: 22px; height: 22px; }
.brand small { display: block; font-weight: 500; font-size: 12px; opacity: .7; }

.show-body { margin: auto 0; padding: 36px 0 28px; max-width: 560px; }
.pill {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
    font-size: 12.5px; font-weight: 600; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, .25); }
.show h1 { margin: 18px 0 14px; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.08; letter-spacing: -.035em; font-weight: 800; }
.show h1 em { font-style: normal; background: linear-gradient(90deg, #fff, #c7d2fe 40%, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-admin .show h1 em { background: linear-gradient(90deg, #fff, #a7f3d0 40%, #d9f99d); -webkit-background-clip: text; background-clip: text; }
.show .lead { margin: 0; font-size: 16px; line-height: 1.6; opacity: .82; max-width: 470px; }

/* Úlgi kartochka (test sorawı / vedomost) */
.mock {
    position: relative; margin-top: 30px; max-width: 440px; padding: 18px;
    border-radius: 20px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 30px 60px -20px rgba(0,0,0,.45);
    animation: float 6s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-8px); } }
.mock-top { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; opacity: .85; margin-bottom: 10px; }
.mock-time { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.22); font-weight: 700; font-variant-numeric: tabular-nums; }
.mock-time svg { width: 13px; height: 13px; }
.mock-bar { height: 5px; border-radius: 5px; background: rgba(255,255,255,.15); overflow: hidden; margin-bottom: 14px; }
.mock-bar i { display: block; height: 100%; width: 64%; border-radius: inherit; background: linear-gradient(90deg, #fff, var(--a3)); }
.mock-q { font-weight: 700; font-size: 15px; margin-bottom: 12px; }
.mock-opt { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-top: 7px; border-radius: 11px; font-size: 13.5px;
    background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); }
.mock-opt b { width: 24px; height: 24px; flex: none; border-radius: 7px; display: grid; place-items: center; font-size: 12px; background: rgba(255,255,255,.14); }
.mock-opt.on { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.55); }
.mock-opt.on b { background: #fff; color: var(--a1); }
.mock-opt.on::after { content: ""; margin-left: auto; width: 16px; height: 16px; border-radius: 50%; background: #4ade80 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23052e16' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/10px no-repeat; }
/* Vedomost úlgisi (admin) */
.mock-row { display: grid; grid-template-columns: 1fr 52px 52px 34px; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; font-size: 13px; }
.mock-row + .mock-row { margin-top: 5px; }
.mock-row.h { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .65; padding-top: 0; }
.mock-row:not(.h) { background: rgba(255,255,255,.07); }
.mock-row span { text-align: center; font-variant-numeric: tabular-nums; }
.mock-row .g { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; background: rgba(255,255,255,.9); color: #065f46; justify-self: center; }
.mock-row .g.g4 { color: #0369a1; }
.mock-row .g.g3 { color: #b45309; }
.mock-tags { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.mock-tags span { font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.14); }
.mock-tags span.on { background: #fff; color: #065f46; }

.show-foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.show-foot div { padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.show-foot b { display: block; font-size: 14px; }
.show-foot span { font-size: 12px; opacity: .72; }

/* ---------- Oń tárep (forma) ---------- */
.side { display: flex; flex-direction: column; padding: 18px clamp(18px, 4vw, 64px); min-width: 0; }
.side-top { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.side-top a { font-size: 13.5px; font-weight: 600; text-decoration: none; padding: 8px 12px; border-radius: 10px; }
.side-top a:hover { background: var(--field); }
.tbtn {
    width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; cursor: pointer;
    border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.tbtn svg { width: 18px; height: 18px; }
.tbtn .i-sun, html[data-theme="dark"] .tbtn .i-moon { display: none; }
html[data-theme="dark"] .tbtn .i-sun { display: block; }

.form-box { width: 100%; max-width: 400px; margin: auto; padding: 28px 0; }
.form-box .kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--a1); }
html[data-theme="dark"] .form-box .kicker { color: #a5b4fc; }
html[data-theme="dark"] .auth-admin .form-box .kicker { color: #6ee7b7; }
.form-box h2 { margin: 10px 0 6px; font-size: 30px; line-height: 1.15; letter-spacing: -.03em; font-weight: 800; }
.form-box .sub { margin: 0 0 26px; color: var(--muted); }

.fld { display: block; margin-bottom: 16px; }
.fld > span:first-child { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
.inp { position: relative; display: block; }
.inp > svg { position: absolute; left: 15px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; transition: color .15s; }
.inp input {
    width: 100%; height: 52px; padding: 0 48px 0 46px; font: inherit; font-size: 15.5px; color: var(--text);
    background: var(--field); border: 1.5px solid var(--field-line); border-radius: 14px; outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.inp input::placeholder { color: var(--muted); opacity: .7; }
.inp input:focus { border-color: var(--a1); background: var(--surface); box-shadow: 0 0 0 4px var(--ring); }
.inp:focus-within > svg { color: var(--a1); }
.eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.eye:hover { background: var(--line); color: var(--text); }
.eye svg { width: 18px; height: 18px; }
.eye.on { color: var(--a1); }
.fld .caps { display: none; margin-top: 7px; font-size: 12.5px; color: #d97706; font-weight: 600; }
.fld .caps.show-caps { display: block; }

.go {
    width: 100%; height: 54px; margin-top: 6px; border: 0; border-radius: 14px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    font: 700 16px Inter, system-ui, sans-serif; color: #fff;
    background: linear-gradient(135deg, var(--a1), var(--a2));
    box-shadow: 0 14px 30px -12px var(--a1); transition: transform .15s, box-shadow .15s, filter .15s;
}
.go svg { width: 18px; height: 18px; transition: transform .15s; }
.go:hover { filter: brightness(1.06); box-shadow: 0 18px 36px -12px var(--a1); }
.go:hover svg { transform: translateX(3px); }
.go:active { transform: translateY(1px); }
.go:disabled { opacity: .75; cursor: wait; }
.go .spin { display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite; }
.go.busy .spin { display: block; }
.go.busy svg { display: none; }
@keyframes sp { to { transform: rotate(360deg); } }

.alert2 { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 18px; border-radius: 12px; font-size: 14px; font-weight: 500;
    background: var(--err-bg); color: var(--err-tx); border: 1px solid var(--err-ln); animation: shake .4s; }
.alert2 svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.hint { display: flex; gap: 12px; margin-top: 22px; padding: 14px; border-radius: 14px; background: var(--field); border: 1px dashed var(--field-line); font-size: 13px; color: var(--muted); }
.hint svg { width: 18px; height: 18px; flex: none; color: var(--a1); margin-top: 1px; }
.hint b { color: var(--text); }
.hint code { font: 600 12.5px ui-monospace, Consolas, monospace; padding: 1px 6px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); color: var(--text); }
.side-foot { text-align: center; font-size: 12.5px; color: var(--muted); }

/* ---------- Planshet / telefon ---------- */
@media (max-width: 980px) {
    .auth-wrap { grid-template-columns: minmax(0, 1fr); padding: 10px; }
    .show { padding: 22px 20px 24px; border-radius: 22px; }
    .show-body { padding: 18px 0 0; margin: 0; }
    .show h1 { font-size: 26px; margin: 12px 0 8px; }
    .show .lead { font-size: 14px; }
    .mock, .show-foot { display: none; }
    .side { padding: 6px 8px 14px; }
    .side-top { order: -1; position: absolute; top: 20px; right: 20px; }
    .side-top a { display: none; }
    .tbtn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); color: #fff; }
    .form-box { padding: 22px 6px 18px; }
    .form-box h2 { font-size: 24px; }
    .form-box .sub { margin-bottom: 20px; font-size: 14px; }
}
@media (max-width: 420px) {
    .show h1 { font-size: 23px; }
    .brand { font-size: 14.5px; }
    .brand .logo { width: 38px; height: 38px; }
    .inp input { height: 50px; font-size: 16px; } /* iOS zoom bolmasın */
    .go { height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
    .show .orb, .mock { animation: none; }
}
