/* Kirish sahifasi (templates/admin/login.html).
   Kompozitsiya: chapda shisha karta (forma), o'ngda yumaloq ramkadagi Samarqand firuza gumbazi.
   Rang: saytdagi firuza (static/css/site.css: --accent) va logodagi grafit; forma tomoni Unfold tokenlari bilan
   yorug'/qorong'i temaga moslashadi. Fonda — koshinlardagi sakkiz qirrali yulduz (girih) naqshi, juda xira.
   Shriftlar saytning o'zidan (static/fonts, OFL): sarlavha — Unbounded, kichik tizim yozuvlari — JetBrains Mono. */

@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/unbounded-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/unbounded-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("../fonts/unbounded-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("../fonts/jetbrains-mono-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

.sx-login {
    /* Brend */
    --sx-accent: #0ef0d5;
    --sx-accent-lo: #00b99c;
    --sx-night: #071417;
    --sx-display: "Unbounded", "Manrope", system-ui, sans-serif;
    --sx-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
    /* Yorug' tema */
    --sx-page: #eef4f4;
    --sx-ink: var(--color-base-900);
    --sx-text: var(--color-base-600);
    --sx-muted: var(--color-base-500);
    --sx-glass: rgb(255 255 255 / .8);
    --sx-glass-line: rgb(255 255 255 / .9);
    --sx-field: #fff;
    --sx-field-line: var(--color-base-200);
    --sx-label-on: var(--color-primary-700);
    --sx-track: var(--color-base-300);
    /* Kursor holati (static/js/login.js) */
    --sx-x: 50%;
    --sx-y: 50%;
    --px: 0px;
    --py: 0px;

    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--sx-page);
    color: var(--sx-text);
    isolation: isolate;
}

.dark .sx-login {
    --sx-page: var(--sx-night);
    --sx-ink: #eef6f6;
    --sx-text: #b5c7ca;
    --sx-muted: #8ea4a8;
    --sx-glass: rgb(13 30 35 / .72);
    --sx-glass-line: rgb(255 255 255 / .08);
    --sx-field: rgb(255 255 255 / .04);
    --sx-field-line: rgb(255 255 255 / .12);
    --sx-label-on: var(--sx-accent);
    --sx-track: rgb(255 255 255 / .18);
}

.sx-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Fon: koshinlardagi sakkiz qirrali yulduz naqshi, kartaga yaqin joyda ko'rinadi, chetga qarab yo'qoladi */
.sx-backdrop {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(600px circle at 22% 30%, rgb(14 240 213 / .18), transparent 70%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23007d6e' stroke-opacity='.16' stroke-width='1'%3E%3Cpath d='M20 20h32v32H20z'/%3E%3Cpath d='M36 13.4 58.6 36 36 58.6 13.4 36z'/%3E%3Cpath d='M36 0v13.4M36 58.6V72M0 36h13.4M58.6 36H72M0 0l20 20M72 0 52 20M0 72l20-20M72 72 52 52'/%3E%3C/g%3E%3C/svg%3E");
    -webkit-mask-image: radial-gradient(ellipse 70% 80% at 25% 50%, #000 10%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 80% at 25% 50%, #000 10%, transparent 75%);
}

.dark .sx-backdrop {
    background:
        radial-gradient(600px circle at 22% 30%, rgb(14 240 213 / .12), transparent 70%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%230ef0d5' stroke-opacity='.09' stroke-width='1'%3E%3Cpath d='M20 20h32v32H20z'/%3E%3Cpath d='M36 13.4 58.6 36 36 58.6 13.4 36z'/%3E%3Cpath d='M36 0v13.4M36 58.6V72M0 36h13.4M58.6 36H72M0 0l20 20M72 0 52 20M0 72l20-20M72 72 52 52'/%3E%3C/g%3E%3C/svg%3E");
}

/* --- Chap tomon: logotip, til/tema, karta -------------------------------------------------- */
.sx-side {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 24px clamp(20px, 4vw, 56px) 32px;
}

.sx-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sx-logo {
    display: inline-flex;
    padding: 6px 0;
}

.sx-logo img {
    width: 150px;
    height: auto;
}

.sx-logo__dark,
.dark .sx-logo__light {
    display: none;
}

.dark .sx-logo__dark {
    display: block;
}

.sx-tools {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--sx-text);
}

.sx-lang {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--sx-field-line);
    border-radius: 999px;
    background: var(--sx-glass);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.sx-lang button {
    min-width: 40px;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--sx-text);
    font-family: var(--sx-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .06em;
    cursor: pointer;
}

.sx-lang button:hover {
    color: var(--sx-ink);
}

.sx-lang button[aria-pressed="true"] {
    background: var(--sx-ink);
    color: var(--sx-page);
}

.sx-main {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 32px 0 8px;
}

/* Shisha karta; chegarasi kursor ortidan firuza bo'lib yonadi */
.sx-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 36px 34px 28px;
    border: 1px solid var(--sx-glass-line);
    border-radius: 26px;
    background: var(--sx-glass);
    box-shadow:
        0 40px 80px -40px rgb(7 20 23 / .45),
        0 12px 24px -16px rgb(7 20 23 / .25);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    backdrop-filter: blur(22px) saturate(140%);
}

.sx-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: 0;
    padding: 1.5px;
    border-radius: inherit;
    background: radial-gradient(260px circle at var(--sx-x) var(--sx-y), var(--sx-accent), transparent 70%);
    opacity: 0;
    /* faqat 1.5px chegara qoladi: ichki (content-box) qism ayirib tashlanadi */
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    transition: opacity .3s;
    pointer-events: none;
}

.sx-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background: radial-gradient(360px circle at var(--sx-x) var(--sx-y), rgb(14 240 213 / .08), transparent 70%);
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}

.sx-card.is-lit::before,
.sx-card.is-lit::after,
.sx-card:focus-within::before {
    opacity: 1;
}

/* Karta ichidagilar birin-ketin paydo bo'ladi */
.sx-card > * {
    position: relative;
    z-index: 1;
    animation: sx-rise .6s cubic-bezier(.2, .7, .2, 1) both;
}

.sx-card > :nth-child(2) { animation-delay: .05s; }
.sx-card > :nth-child(3) { animation-delay: .1s; }
.sx-card > :nth-child(4) { animation-delay: .15s; }
.sx-card > :nth-child(5) { animation-delay: .2s; }
.sx-card > :nth-child(6) { animation-delay: .25s; }

.sx-hello {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    color: var(--sx-text);
    font-family: var(--sx-mono);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sx-hello__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sx-accent-lo);
    box-shadow: 0 0 0 4px rgb(14 240 213 / .2);
    animation: sx-pulse 2.4s ease-in-out infinite;
}

.sx-title {
    margin: 0;
    color: var(--sx-ink);
    font-family: var(--sx-display);
    font-size: clamp(25px, 2.2vw, 30px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.01em;
    text-wrap: balance;
}

.sx-lead {
    margin: 10px 0 26px;
    color: var(--sx-text);
    font-size: 15px;
    line-height: 1.5;
}

.sx-alert {
    display: flex;
    gap: 10px;
    margin: -6px 0 18px;
    padding: 12px 14px;
    border-radius: 14px;
    background: color-mix(in oklab, #ef4444 12%, transparent);
    color: #b42318;
    font-size: 14px;
    line-height: 1.45;
}

.dark .sx-alert {
    color: #fca5a5;
}

.sx-alert p {
    margin: 0;
}

.sx-alert .material-symbols-outlined {
    flex: none;
    font-size: 20px;
}

.sx-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sx-form.has-error .sx-float {
    animation: sx-shake .4s ease-in-out;
}

/* Suzuvchi yorliq: bo'sh maydonda — ichkarida, yozilganda yoki fokusda — tepaga kichrayib chiqadi */
.sx-float {
    position: relative;
}

.sx-float input {
    width: 100%;
    height: 60px;
    padding: 22px 50px 6px 48px;
    border: 1px solid var(--sx-field-line);
    border-radius: 16px;
    background: var(--sx-field);
    color: var(--sx-ink);
    font-size: 16px;
    box-shadow: none;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}

.sx-float input:hover {
    border-color: color-mix(in oklab, var(--color-primary-600) 45%, var(--sx-field-line));
}

.sx-float input:focus {
    border-color: var(--color-primary-600);
    outline: none;
    box-shadow: 0 0 0 4px color-mix(in oklab, var(--sx-accent) 22%, transparent);
}

.sx-form.has-error .sx-float input {
    border-color: #ef4444;
}

.sx-float label {
    position: absolute;
    top: 50%;
    left: 48px;
    color: var(--sx-muted);
    font-size: 15px;
    pointer-events: none;
    transform: translateY(-50%);
    transform-origin: left top;
    transition: top .18s ease, font-size .18s ease, color .18s ease, transform .18s ease;
}

.sx-float input:focus + label,
.sx-float input:not(:placeholder-shown) + label,
.sx-float input:-webkit-autofill + label {
    top: 10px;
    color: var(--sx-label-on);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    transform: none;
}

.sx-float__icon {
    position: absolute;
    top: 50%;
    left: 16px;
    z-index: 1;
    color: var(--sx-muted);
    font-size: 20px;
    pointer-events: none;
    transform: translateY(-50%);
    transition: color .2s;
}

.sx-float:focus-within .sx-float__icon {
    color: var(--color-primary-600);
}

.dark .sx-float:focus-within .sx-float__icon {
    color: var(--sx-accent);
}

.sx-eye {
    position: absolute;
    top: 50%;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: var(--sx-muted);
    cursor: pointer;
    transform: translateY(-50%);
}

.sx-eye:hover {
    background: color-mix(in oklab, var(--sx-ink) 7%, transparent);
    color: var(--sx-ink);
}

.sx-eye[hidden] {
    display: none;
}

.sx-eye .material-symbols-outlined {
    font-size: 20px;
}

.sx-field-error {
    margin: -6px 0 0 4px;
    color: #dc2626;
    font-size: 13px;
}

.sx-caps {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 6px;
    margin: -4px 0 0;
    padding: 4px 10px;
    border-radius: 999px;
    background: color-mix(in oklab, #f59e0b 16%, transparent);
    color: #92400e;
    font-size: 13px;
    font-weight: 600;
}

.dark .sx-caps {
    color: #fbbf24;
}

.sx-caps[hidden] {
    display: none;
}

.sx-caps .material-symbols-outlined {
    font-size: 18px;
}

.sx-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 2px 0 4px;
}

/* «Meni eslab qol» almashtirgichi */
.sx-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 32px;
    color: var(--sx-text);
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.sx-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.sx-switch__track {
    position: relative;
    flex: none;
    width: 40px;
    height: 24px;
    border-radius: 999px;
    background: var(--sx-track);
    transition: background-color .2s;
}

.sx-switch__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgb(0 0 0 / .3);
    transition: transform .2s cubic-bezier(.3, .7, .3, 1.3);
}

.sx-switch input:checked + .sx-switch__track {
    background: var(--color-primary-600);
}

.sx-switch input:checked + .sx-switch__track .sx-switch__thumb {
    transform: translateX(16px);
}

.sx-switch input:focus-visible + .sx-switch__track {
    outline: 2px solid var(--color-primary-600);
    outline-offset: 2px;
}

/* Kirish tugmasi: to'q firuza (oq matn 4.5:1 dan yuqori), ustidan yorug'lik o'tadi */
.sx-submit {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 56px;
    margin-top: 4px;
    overflow: hidden;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--color-primary-700), #007a69);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 14px 28px -14px rgb(0 122 105 / .7);
    transition: transform .12s, box-shadow .2s, filter .2s;
}

.sx-submit::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 -45%;
    width: 35%;
    background: linear-gradient(90deg, transparent, rgb(255 255 255 / .3), transparent);
    transform: skewX(-22deg);
    transition: left .7s ease;
}

.sx-submit:hover {
    filter: brightness(1.08);
    box-shadow: 0 18px 32px -14px rgb(0 122 105 / .8);
}

.sx-submit:hover::before {
    left: 125%;
}

.sx-submit:active {
    transform: translateY(1px) scale(.995);
}

.sx-submit__icon {
    font-size: 20px;
    transition: transform .2s;
}

.sx-submit:hover .sx-submit__icon {
    transform: translateX(4px);
}

.sx-submit.is-busy {
    pointer-events: none;
    filter: saturate(.8);
}

.sx-submit.is-busy .sx-submit__icon {
    width: 18px;
    height: 18px;
    border: 2px solid rgb(255 255 255 / .35);
    border-top-color: #fff;
    border-radius: 50%;
    font-size: 0;
    animation: sx-spin .7s linear infinite;
}

.sx-submit:focus-visible,
.sx-eye:focus-visible,
.sx-lang button:focus-visible,
.sx-logo:focus-visible,
.sx-credit:focus-visible {
    outline: 2px solid var(--color-primary-600);
    outline-offset: 3px;
}

.sx-help {
    display: flex;
    gap: 8px;
    margin: 22px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--sx-field-line);
    color: var(--sx-text);
    font-size: 13px;
    line-height: 1.5;
}

.sx-help .material-symbols-outlined {
    flex: none;
    font-size: 18px;
    color: var(--sx-muted);
}

/* --- O'ng tomon: Samarqand gumbazi --------------------------------------------------------- */
.sx-photo {
    position: relative;
    margin: 16px 16px 16px 0;
    overflow: hidden;
    border-radius: 30px;
    background: #10233c;
    box-shadow: 0 30px 60px -30px rgb(7 20 23 / .6);
}

.sx-photo picture {
    position: absolute;
    inset: 0;
}

/* Kursorga qarab biroz suriladi (chetlar ochilmasin deb sal kattaroq) */
.sx-photo__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 32%;
    transform: translate3d(var(--px), var(--py), 0) scale(1.08);
    transition: transform .6s cubic-bezier(.2, .7, .2, 1);
    /* backwards: animatsiya tugagach transform yana parallaksga bo'ysunadi */
    animation: sx-reveal 1.2s cubic-bezier(.2, .7, .2, 1) backwards;
}

/* Yozuv — gumbaz ustidagi bo'sh to'q osmonda (pastdagi naqshli devorda o'qilmaydi) */
.sx-photo__caption {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: clamp(28px, 3.4vw, 48px);
    background: linear-gradient(180deg, rgb(7 20 23 / .35), transparent 38%);
    color: #fff;
    pointer-events: none;
}

.sx-motto {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--sx-accent);
    font-family: var(--sx-mono);
    font-size: 13px;
    letter-spacing: .32em;
    text-transform: uppercase;
}

.sx-motto::before {
    content: "";
    width: 36px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--sx-accent));
}

.sx-photo__text {
    max-width: 15rem;  /* gumbaz uchidagi nayzaga tegmasin */
    text-shadow: 0 2px 18px rgb(7 20 23 / .5);
    font-family: var(--sx-display);
    font-size: clamp(22px, 2vw, 30px);
    font-weight: 600;
    line-height: 1.2;
    text-wrap: balance;
}

.sx-credit {
    margin-top: auto;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgb(7 20 23 / .5);
    color: rgb(255 255 255 / .8);
    font-size: 12px;
    pointer-events: auto;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.sx-credit:hover {
    color: #fff;
    text-decoration: underline;
}

@keyframes sx-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@keyframes sx-reveal {
    from { opacity: 0; transform: scale(1.16); }
    to { opacity: 1; transform: translate3d(var(--px), var(--py), 0) scale(1.08); }
}

@keyframes sx-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgb(14 240 213 / .2); }
    50% { box-shadow: 0 0 0 7px rgb(14 240 213 / .06); }
}

@keyframes sx-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(7px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(3px); }
}

@keyframes sx-spin {
    to { transform: rotate(360deg); }
}

/* --- Tor ekran: tepada logotip, keyin surat tasmasi, karta uning ustiga chiqadi --------------- */
@media (max-width: 1023px) {
    .sx-login {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "top" "photo" "main";
        grid-template-rows: auto auto 1fr;
    }

    .sx-side {
        display: contents;
    }

    .sx-top {
        grid-area: top;
        padding: 16px 16px 12px;
    }

    .sx-photo {
        grid-area: photo;
        height: clamp(220px, 34vh, 360px);
        margin: 0 16px;
        border-radius: 24px;
    }

    .sx-photo__caption {
        padding: 12px;
        background: none;
    }

    .sx-motto,
    .sx-photo__text {
        display: none;
    }

    .sx-credit {
        margin: 0;
        font-size: 11px;
    }

    /* Telefonda karta suratning pastki qismini yopadi — gumbaz ko'rinsin */
    .sx-photo__img {
        object-position: center 22%;
    }

    .sx-main {
        position: relative;
        z-index: 2;  /* DOM'da surat keyin keladi — karta uning ustida tursin */
        grid-area: main;
        align-items: flex-start;
        margin-top: -72px;
        padding: 0 16px 24px;
    }

    .sx-card {
        padding: 28px 22px 22px;
    }
}

/* Harakatni kamaytirish: hammasi joyida, kirish animatsiyalari yo'q */
@media (prefers-reduced-motion: reduce) {
    .sx-card > *,
    .sx-photo__img,
    .sx-hello__dot,
    .sx-form.has-error .sx-float {
        animation: none !important;
    }

    .sx-photo__img {
        transform: scale(1.08);
        transition: none;
    }
}
