/* =========================================================
   KIRISH / RO'YXATDAN O'TISH — platforma qobig'iga mos ko'rinish.
   platform.css dan keyin ulanadi va o'sha yerdagi tokenlardan
   (--siyoh, --anor, --firuza, Bitter/Karla) foydalanadi.
   Mashq sahifalarining style.css i bu yerda ISHLATILMAYDI.
   ========================================================= */

.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px;
    position: relative;
    isolation: isolate;
    background: var(--siyoh);
}
/* Fon: bo'lim sarlavhalaridagi kabi — rasm ::before da, ustidagi
   indigo parda ::after da (platform.css dagi .page-head bilan bir xil usul). */
.auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image: url('/static/img/hero-qogoz.jpg');
    background-size: cover;
    background-position: center;
}
.auth-page::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(158deg, rgba(20, 32, 58, 0.97) 0%, rgba(20, 32, 58, 0.93) 55%, rgba(31, 49, 87, 0.90) 100%);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 38px 36px 30px;
    box-shadow: 0 26px 60px rgba(9, 15, 30, 0.42);
}

/* Kartaning tepasidagi brend — sayt bilan bog'lab turadi */
.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin-bottom: 22px;
    text-decoration: none;
}
.auth-brand img { width: 46px; height: 46px; }
.auth-brand span {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    text-align: left;
}
.auth-brand .sub {
    font-size: 0.63rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--anor);
}
.auth-brand .name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.06rem;
    color: var(--siyoh);
}

.auth-card h1 {
    text-align: center;
    font-size: 1.72rem;
    font-weight: 800;
    color: var(--siyoh);
    margin-bottom: 8px;
}
.auth-card .subtitle {
    text-align: center;
    color: var(--ink-2);
    font-size: 0.95rem;
    margin: 0 0 26px;
}

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    color: var(--ink);
    font-size: 0.86rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.form-group input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 15px;
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}
.form-group input::placeholder { color: var(--ink-3); }
.form-group input:focus {
    border-color: var(--firuza);
    box-shadow: 0 0 0 3px rgba(23, 134, 140, 0.16);
}

/* Rol tanlash (ro'yxatdan o'tish sahifasi) */
.role-group { display: flex; gap: 12px; }
.role-option { flex: 1; cursor: pointer; }
.role-option input { position: absolute; opacity: 0; pointer-events: none; }
.role-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 13px 10px;
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    background: var(--stone);
    color: var(--ink-2);
    font-size: 0.95rem;
    font-weight: 700;
    transition: border-color 0.18s, background-color 0.18s, color 0.18s;
}
.role-option span:hover { border-color: var(--firuza); }
.role-option input:checked + span {
    border-color: var(--siyoh);
    background: var(--siyoh);
    color: #fff;
}
.role-option input:focus-visible + span {
    outline: 3px solid var(--zafaron);
    outline-offset: 3px;
}

.auth-btn {
    width: 100%;
    margin-top: 6px;
    padding: 14px 24px;
    border: 1.5px solid var(--anor);
    border-radius: 999px;
    background: var(--anor);
    color: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.18s, border-color 0.18s, transform 0.16s ease;
}
.auth-btn:hover {
    background: var(--anor-d);
    border-color: var(--anor-d);
    transform: translateY(-2px);
}
.auth-btn:active { transform: translateY(0); }

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: var(--ink-2);
    font-size: 0.92rem;
}
.auth-link a { color: var(--firuza); text-decoration: none; font-weight: 700; }
.auth-link a:hover { text-decoration: underline; }

.error-msg {
    background: #FBEDEB;
    border: 1px solid #E9C4BF;
    color: var(--anor-d);
    padding: 11px 14px;
    border-radius: var(--r-md);
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 18px;
    text-align: center;
}

.back-home {
    display: block;
    text-align: center;
    margin-top: 14px;
    color: var(--ink-3);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}
.back-home:hover { color: var(--siyoh); }

@media (max-width: 480px) {
    .auth-card { padding: 30px 22px 24px; }
    .form-row { flex-direction: column; gap: 0; }
    .role-group { flex-direction: column; }
}


/* =========================================================
   YORQIN USLUB — kirish/ro'yxatdan o'tish
   =========================================================
   Sahifa saytning qolgan qismi bilan bir xil bo'lishi kerak:
   och havorang fon, ko'k tugma, Fredoka sarlavha.

   Ilgari fon to'q ko'k edi va ustiga foto qo'yilgandi — u
   jiddiy uslubdan qolgan. Tugma esa anor rangida edi; anor
   endi "xato" ni bildiradi, shuning uchun tugma bo'la olmaydi.

   Bu blok fayl oxirida turadi va yuqoridagi qoidalarni bir xil
   kuchdagi selektorlar bilan yengadi.
   ========================================================= */
.auth-page {
    background: linear-gradient(180deg, #DCEEFB 0%, #EAF4FE 45%, #F3F9FF 100%);
}

/* Eski foto va uning ustidagi to'q parda */
.auth-page::before,
.auth-page::after { content: none; }

.auth-card {
    border: 1px solid #DCE9F6;
    border-radius: 24px;
    box-shadow: 0 8px 18px rgba(20, 40, 80, .07), 0 26px 50px rgba(20, 40, 80, .12);
}

.auth-card h1 {
    font-family: 'Fredoka', 'Nunito', system-ui, sans-serif;
    font-weight: 600;
    color: #22384F;
}

/* Brend — navbardagi bilan bir xil: ko'k va yashil */
.auth-brand span > :first-child {
    font-family: 'Fredoka', 'Nunito', system-ui, sans-serif;
    font-size: 1.16rem;
    font-weight: 600;
    letter-spacing: -.2px;
    text-transform: none;
    color: #2E7DE0;
}

.auth-brand span > :last-child {
    font-family: 'Fredoka', 'Nunito', system-ui, sans-serif;
    font-size: .9rem;
    font-weight: 500;
    text-transform: lowercase;
    color: #43A047;
}

/* Tugma — ko'k. Anor endi faqat xatoni bildiradi. */
.auth-btn {
    background: #2E7DE0;
    border-color: #2E7DE0;
    font-family: 'Nunito', system-ui, sans-serif;
    font-weight: 800;
    box-shadow: 0 4px 0 #1F5FAF;
}

.auth-btn:hover {
    background: #1F5FAF;
    border-color: #1F5FAF;
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #17497F;
}

.auth-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #1F5FAF; }

.form-group input:focus { border-color: #2E7DE0; }
.form-group label { font-family: 'Nunito', system-ui, sans-serif; font-weight: 700; }
.auth-link a { color: #2E7DE0; font-weight: 800; }
.role-option { border-radius: 14px; }
.error-msg { border-radius: 12px; }


/* =========================================================
   YORQIN USLUB 2 — bosh sahifa tiliga o'tish (2026-09-05)
   Osmon fon: bulutlar va quyosh (radial-gradient), karta 30px
   yumaloq, maydonlar 16px, tugma tabletka va qattiq soya.
   ========================================================= */
.auth-page { background: linear-gradient(180deg, #C9E3FA 0%, #DDEDFB 55%, #EAF4FE 100%); }

.auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        radial-gradient(circle at 86% 12%, #FFD84D 0 34px, rgba(255, 216, 77, .35) 35px 48px, transparent 49px),
        var(--bulut-rasm),
        var(--bulut-rasm),
        var(--bulut-rasm);
    background-size: auto, 250px 150px, 200px 120px, 130px 78px;
    background-position: 0 0, 5% 88%, 78% 92%, 26% 12%;
    background-repeat: no-repeat;
}

.auth-page::after { content: none; }

.auth-card {
    max-width: 460px;
    padding: 40px 38px 32px;
    border: 2px solid #E3EDF8;
    border-radius: 30px;
    box-shadow: 0 10px 0 #BFD8F2, 0 30px 60px rgba(20, 40, 80, .16);
}

.auth-brand img { width: 52px; height: 52px; }
.auth-card h1 { font-size: 2rem; }
.auth-card .subtitle { font-weight: 600; }

.form-group label { font-size: .9rem; font-weight: 800; color: #22384F; }

.form-group input {
    padding: 13px 16px;
    border: 2px solid #DCE9F6;
    border-radius: 16px;
    font-weight: 600;
}

.form-group input:focus { border-color: #2E7DE0; box-shadow: 0 0 0 4px rgba(46, 125, 224, .16); }

.role-option span {
    padding: 13px 12px;
    border: 2px solid #DCE9F6;
    border-radius: 999px;
    background: #fff;
    color: #35506F;
    font-weight: 800;
}

.role-option span:hover { border-color: #2E7DE0; }
.role-option input:checked + span { background: #2E7DE0; border-color: #2E7DE0; color: #fff; box-shadow: 0 3px 0 #1F5FAF; }

.auth-btn {
    padding: 15px 24px;
    border: 0;
    background: linear-gradient(180deg, #4E9AF2 0%, #2E7DE0 55%, #1E62C4 100%);
    font-family: 'Fredoka', 'Nunito', system-ui, sans-serif;
    font-size: 1.12rem;
    font-weight: 600;
    letter-spacing: .01em;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .28), 0 5px 0 #174E9E, 0 12px 24px rgba(46, 125, 224, .3);
}

.auth-btn:hover  { background: linear-gradient(180deg, #4E9AF2 0%, #2E7DE0 55%, #1E62C4 100%); transform: translateY(-2px); box-shadow: inset 0 2px 0 rgba(255,255,255,.28), 0 7px 0 #174E9E, 0 16px 28px rgba(46,125,224,.34); }
.auth-btn:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255,255,255,.28), 0 1px 0 #174E9E; }

.error-msg { border: 2px solid #F5C2BE; border-radius: 16px; background: #FDECEA; color: #C23328; }
.back-home:hover { color: #2E7DE0; }


/* ---------- Parol ko'z tugmasi ----------
   Maydon o'ng tomonida dumaloq tugma; bosilganda `type` almashadi
   (login.html / register.html dagi kichik skript) va ikonka
   ochiq/yopiq ko'zga o'zgaradi. */
.parol-quti { position: relative; }
.parol-quti input { padding-right: 52px; }

.parol-koz {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8597AE;
    cursor: pointer;
    transition: background-color .16s, color .16s;
}

.parol-koz:hover { background: #EAF2FB; color: #2E7DE0; }
.parol-koz:focus-visible { outline: 3px solid rgba(46, 125, 224, .35); outline-offset: 1px; }
.parol-koz svg { width: 22px; height: 22px; }
.parol-koz .koz-yopiq { display: none; }
.parol-koz.ochiq .koz-ochiq { display: none; }
.parol-koz.ochiq .koz-yopiq { display: block; }
.parol-koz.ochiq { color: #2E7DE0; }
