@font-face {
    font-family: AuthYekan;
    src: url('../fonts/yekan/YekanBakh-Medium.woff') format('woff');
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
}

@font-face {
    font-family: AuthYekan;
    src: url('../fonts/yekan/YekanBakh-Bold.woff') format('woff');
    font-style: normal;
    font-weight: 600 800;
    font-display: swap;
}

.admin-auth {
    margin: 0;
    color: #28364a;
    background: #f3f6fb;
    font: 500 16px/1.7 AuthYekan, Tahoma, sans-serif;
    color-scheme: light;
    -webkit-font-smoothing: antialiased;
}

.admin-auth *, .admin-auth *::before, .admin-auth *::after { box-sizing: border-box; }
.admin-auth [hidden] { display: none !important; }
.admin-auth button, .admin-auth input { font: inherit; }
.admin-auth button, .admin-auth a, .admin-auth input { -webkit-tap-highlight-color: transparent; }
.admin-auth button, .admin-auth a { touch-action: manipulation; }
.admin-auth button { cursor: pointer; }
.admin-auth button:disabled { cursor: default; }
.admin-auth svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.admin-auth .auth-icons { position: absolute; width: 0; height: 0; overflow: hidden; }

.admin-auth::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('../img/admin-auth-background.svg') center / cover;
    pointer-events: none;
}

.auth-page {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: 32px 20px;
    background: radial-gradient(ellipse at 50% 40%, #fff4, transparent 70%);
}

.auth-card {
    position: relative;
    width: min(100%, 440px);
    padding: 22px 32px 26px;
    overflow: hidden;
    border: 1px solid #ffffffc9;
    border-radius: 30px;
    background: linear-gradient(135deg, #ffffffc9, #eef4ffbf);
    box-shadow: 0 28px 68px -30px #48658b59, 0 3px 12px -5px #8097b326,
        inset 0 1px 1px #fff, inset 1px 0 0 #ffffffb3, inset 0 -1px 1px #9aafc533;
    animation: auth-enter .35s ease-out both;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .auth-card {
        background: linear-gradient(125deg, #ffffff38, #d7e6f71f 55%, #ffffff1c);
        backdrop-filter: blur(4px) saturate(145%);
        -webkit-backdrop-filter: blur(4px) saturate(145%);
    }
}

.auth-handle { width: 44px; height: 4px; margin: 0 auto 16px; border-radius: 4px; background: #a4b2c34d; }
.auth-brand { margin-bottom: 20px; color: #2874db; text-align: center; font-size: 40px; line-height: 1.3; font-weight: 800; letter-spacing: -.8px; }
.auth-heading { text-align: center; }
.auth-emblem { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 16px; border: 1px solid #ffffffd9; border-radius: 19px; color: #70829c; background: linear-gradient(135deg, #ffffff66, #dce9fb24); box-shadow: 0 8px 20px -12px #6b8bbd66, inset 0 1px 0 #ffffffc9; }
.auth-emblem svg { width: 37px; height: 37px; stroke-width: 1.8; }
.auth-icon-accent { stroke: #388cf1; }
.auth-heading h1 { margin: 0; font-size: 25px; line-height: 1.6; font-weight: 800; }
.auth-heading p { margin: 6px 0 24px; color: #64738a; font-size: 15px; }
.auth-form { display: grid; gap: 22px; }
.auth-field label { display: block; margin-bottom: 8px; font-size: 15px; font-weight: 700; }

.auth-field input {
    display: block;
    width: 100%;
    min-width: 0;
    height: 54px;
    padding: 10px 16px;
    border: 1.5px solid #c6d2e2;
    border-radius: 13px;
    outline: none;
    color: #293950;
    background: #ffffff40;
    box-shadow: inset 0 1px 1px #ffffffb3, 0 2px 6px -4px #6f8fb133;
    transition: border-color .18s, box-shadow .18s, background .18s;
}

.auth-field input::placeholder { color: #9aa8bc; font-size: 15px; }
.auth-field input:focus { border-color: #56a3fa; background: #ffffff73; box-shadow: 0 0 0 3px #61b9ff1a, 0 5px 18px -12px #2088ff80; }
.auth-field input.is-invalid, .auth-field input.input-validation-error { border-color: #db7981; }
.auth-phone-field { position: relative; }
.auth-phone-field input { padding-left: 47px; font-size: 19px; letter-spacing: .4px; }
.auth-phone-field svg { position: absolute; top: 15px; left: 15px; width: 22px; color: #6c7e96; pointer-events: none; }
.auth-captcha-row { display: grid; grid-template-columns: 116px 42px minmax(0, 1fr); align-items: center; gap: 9px; }
.auth-captcha-row img { display: block; width: 116px; height: 48px; object-fit: contain; border: 1px solid #cad7e7; border-radius: 10px; background: #fff; }
.auth-captcha-row input { height: 48px; padding: 8px 10px; text-align: center; }
.auth-refresh { display: grid; place-items: center; width: 42px; height: 44px; padding: 0; color: #6189bc; border: 1px solid #cbd9ea; border-radius: 10px; background: #ffffff38; }
.auth-refresh:hover { background: #fff; }
.auth-field-error { display: block; margin: 5px 0 0; color: #b23c4e; font-size: 13px; }
.auth-field-error:empty { display: none; }

.auth-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    min-height: 54px;
    padding: 12px 18px;
    border: 1px solid #ffffff24;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(115deg, #4a97f8, #347eea);
    box-shadow: 0 8px 20px -12px #2875e999;
    font-size: 18px;
    font-weight: 700;
    transition: filter .18s, transform .18s;
}

.auth-primary:hover:not(:disabled) { filter: brightness(1.045); }
.auth-primary:active:not(:disabled) { transform: translateY(1px); }
.auth-primary:disabled { opacity: .76; }
.auth-primary svg { width: 23px; height: 23px; stroke-width: 2; }
.auth-primary.is-loading svg { display: none; }
.auth-primary.is-loading::after { content: ''; width: 20px; height: 20px; border: 2px solid #ffffff66; border-top-color: #fff; border-radius: 50%; animation: auth-spin .75s linear infinite; }
.auth-footer { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; color: #6d7d93; font-size: 13px; text-align: center; }
.auth-footer svg { width: 18px; height: 18px; }
.auth-feedback { margin: 0; padding: 9px 12px; border: 1px solid #bcd9fa; border-radius: 10px; color: #376492; background: #edf6ffd9; font-size: 13px; }
.auth-feedback--error { color: #a43849; background: #fff0f2d9; border-color: #edbec6; }
.auth-recipient { display: grid; justify-items: center; gap: 2px; margin: -8px 0 24px; }
.auth-recipient bdi { color: #4c5d77; font: 700 20px/1.7 AuthYekan, Tahoma, sans-serif; letter-spacing: 1px; }
.auth-recipient a, .auth-text-button { color: #2472ce; font-size: 14px; text-decoration: none; }
.auth-recipient a:hover { text-decoration: underline; }
.auth-recipient a[aria-disabled="true"] { pointer-events: none; opacity: .5; }

.auth-otp { --auth-otp-gap: 9px; position: relative; isolation: isolate; direction: ltr; border-radius: 14px; }
.auth-otp-input { width: 100%; height: 61px; padding: 10px 16px; border: 1.5px solid #c4d0e0; border-radius: 13px; color: #2d3c53; background: #ffffff40; text-align: center; font-size: 24px; letter-spacing: 8px; }
.auth-otp.is-enhanced .auth-otp-input { position: absolute; inset: 0; z-index: 1; height: 100%; margin: 0; padding: 0; border: 0; outline: none; color: transparent; caret-color: transparent; background: transparent; -webkit-text-fill-color: transparent; font-size: 16px; letter-spacing: normal; }
.auth-otp.is-enhanced .auth-otp-input::selection { color: transparent; background: transparent; }
.auth-otp-cells { display: none; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--auth-otp-gap); direction: ltr; }
.auth-otp.is-enhanced .auth-otp-cells { display: grid; }
.auth-otp-cell { --auth-cell-shift: calc(2.5 - var(--otp-index)); position: relative; display: grid; place-items: center; aspect-ratio: 1; min-width: 0; border: 1.5px solid #c4d0e0; border-radius: 13px; color: #2d3c53; background: #ffffff2e; box-shadow: 0 4px 10px -6px #9eb5d43b, inset 0 1px 0 #ffffffb3; font-size: 28px; line-height: 1; transition: border-color .18s, box-shadow .18s, background .18s, opacity .18s; }
.auth-otp-cell.is-active { border-color: #e86551; background: #ffffff5c; box-shadow: 0 0 0 2px #ef79551c, 0 0 19px -7px #ed634f9c; }
.auth-otp-cell.is-active:not(.has-digit)::after { content: ''; position: absolute; width: 2px; height: 25px; border-radius: 2px; background: #e86551; animation: auth-caret 1.1s step-end infinite; }
.auth-otp-cell [data-otp-digit] { transition: opacity .32s .16s ease-out; }
.auth-otp-trace { position: absolute; inset: -1px; overflow: hidden; border: 1.5px solid #ef6652; border-radius: inherit; opacity: 0; pointer-events: none; }
.auth-otp-runner { display: none; }
@supports ((mask-composite: exclude) or (-webkit-mask-composite: xor)) {
    .auth-otp-trace {
        padding: 1.8px;
        border: 0;
        -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
    }
    .auth-otp-runner {
        display: block;
        position: absolute;
        inset: -50%;
        background: conic-gradient(transparent 0deg 155deg, #ef66520a 205deg, #ef665240 250deg,
            #ef66529c 300deg, #ef6652 340deg, #ffb7a5 353deg, transparent 355deg 360deg);
    }
}
.auth-otp.is-complete .auth-otp-cell { animation: auth-code-arrive .22s ease-out; }
.auth-otp.is-invalid .auth-otp-cell { border-color: #dc8490; background: #fff5f7b3; box-shadow: none; }
.auth-otp.is-invalid { animation: auth-shake .3s ease-out; }
.auth-resend { position: relative; display: grid; justify-items: center; gap: 4px; min-height: 64px; margin: -4px 0 0; font-size: 14px; }
.auth-countdown { display: flex; align-items: center; gap: 7px; color: #77869d; }
.auth-countdown svg { width: 19px; height: 19px; }
.auth-text-button { min-height: 36px; padding: 3px 12px; border: 0; border-radius: 8px; background: transparent; }
.auth-text-button:disabled { color: #a3afbf; }
.auth-text-button:hover:not(:disabled) { background: #dcecff80; }
.auth-card[data-auth-state="verifying"] .auth-otp-cell,
.auth-card[data-auth-state="merging"] .auth-otp-cell { border-color: #e7685545; background: #ffffff52; box-shadow: 0 0 7px -2px #ed654d66, inset 0 1px 0 #ffffffb3; }
.auth-card[data-auth-state="verifying"] .auth-otp-trace,
.auth-card[data-auth-state="merging"] .auth-otp-trace { opacity: 1; }
.auth-card[data-auth-state="verifying"] .auth-otp-runner,
.auth-card[data-auth-state="merging"] .auth-otp-runner { will-change: transform; animation: auth-border-trace 1.1s linear infinite; }
.auth-card[data-auth-state="merging"] .auth-otp-cell { animation: auth-otp-merge .88s cubic-bezier(.3,.02,.25,1) both; }
.auth-card[data-auth-state="verified"] .auth-otp-cell { transform: translateX(calc((2.5 - var(--otp-index)) * (100% + var(--auth-otp-gap)))); }
.auth-card[data-auth-state="merging"] [data-otp-digit],
.auth-card[data-auth-state="verified"] [data-otp-digit] { opacity: 0; }
.auth-card[data-auth-state="verified"] .auth-otp-cell { opacity: 0; }
.auth-otp-result { display: none; position: absolute; inset-block-start: 0; left: 50%; width: calc((100% - 5 * var(--auth-otp-gap)) / 6); aspect-ratio: 1; transform: translateX(-50%); place-items: center; border: 1.8px solid #43b68d; border-radius: 13px; color: #299c72; background: #effff9c9; box-shadow: 0 0 24px -6px #54cfa573; opacity: 0; pointer-events: none; }
.auth-otp.is-enhanced .auth-otp-result { display: grid; }
.auth-otp-result::before { content: ''; position: absolute; z-index: -1; width: 240px; height: 200px; border-radius: 50%; background: radial-gradient(ellipse, #60d5ac38, #8ce5c51c 35%, transparent 70%); }
.auth-otp-result svg { width: 28px; height: 28px; stroke-width: 2.2; }
.auth-otp-result path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.auth-card[data-auth-state="verified"] .auth-otp-result { opacity: 1; }
.auth-card[data-auth-state="verified"] .auth-otp-result::before { animation: auth-halo .8s ease-out both; }
.auth-card[data-auth-state="verified"] .auth-otp-result path { animation: auth-check-draw .58s .16s ease-in-out forwards; }
.auth-verified-message { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #318369; text-align: center; font-size: 16px; animation: auth-enter .45s .32s ease-out both; }
.auth-card[data-auth-state="verified"] .auth-countdown,
.auth-card[data-auth-state="verified"] #resendBtn { visibility: hidden; }
.auth-card[data-auth-state="verified"] .auth-primary { visibility: hidden; }
.auth-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.admin-auth :focus-visible { outline: 3px solid #3895ed99; outline-offset: 4px; }
.admin-auth input:focus-visible { outline: none; }

@keyframes auth-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes auth-spin { to { transform: rotate(360deg); } }
@keyframes auth-caret { 50% { opacity: 0; } }
@keyframes auth-code-arrive { from { background: #ffebe470; } to { background: #ffffff52; } }
@keyframes auth-border-trace { to { transform: rotate(360deg); } }
@keyframes auth-otp-merge {
    0% { transform: translateX(0) rotate(0); }
    58% { transform: translateX(calc(var(--auth-cell-shift) * (80% + .8 * var(--auth-otp-gap)))) rotate(calc(var(--auth-cell-shift) * -6deg)); }
    100% { transform: translateX(calc(var(--auth-cell-shift) * (100% + var(--auth-otp-gap)))) rotate(0); }
}
@keyframes auth-halo { from { opacity: 0; transform: scale(.75); } to { opacity: 1; transform: scale(1); } }
@keyframes auth-check-draw { to { stroke-dashoffset: 0; } }
@keyframes auth-shake { 25%, 75% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }

@media (max-width: 480px) {
    .auth-page { padding: 22px 16px; }
    .auth-card { padding: 20px 24px 24px; border-radius: 26px; }
    .auth-brand { font-size: 36px; }
    .auth-heading h1 { font-size: 23px; }
    .auth-otp { --auth-otp-gap: 7px; }
    .auth-otp-cell, .auth-otp-result { border-radius: 11px; }
    .auth-otp-cell { font-size: 26px; }
}

@media (max-width: 350px) {
    .auth-card { padding-inline: 18px; }
    .auth-captcha-row { grid-template-columns: 104px 36px minmax(0, 1fr); gap: 6px; }
    .auth-captcha-row img { width: 104px; }
    .auth-refresh { width: 36px; }
    .auth-otp { --auth-otp-gap: 5px; }
    .auth-heading h1 { font-size: 21px; }
}

@media (max-height: 700px) {
    .auth-page { padding-block: 16px; }
    .auth-handle { margin-bottom: 10px; }
    .auth-brand { margin-bottom: 14px; font-size: 32px; }
    .auth-emblem { width: 48px; height: 48px; margin-bottom: 10px; border-radius: 16px; }
    .auth-emblem svg { width: 31px; height: 31px; }
    .auth-heading p { margin-bottom: 18px; }
    .auth-form { gap: 17px; }
    .auth-footer { margin-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .admin-auth *, .admin-auth *::before, .admin-auth *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .auth-card[data-auth-state="verified"] .auth-otp-result path { stroke-dashoffset: 0; }
}

.admin-auth.auth-keyboard-open { padding-bottom: var(--auth-keyboard-inset, 0px); }
.auth-keyboard-open .auth-page { min-height: var(--auth-visible-height, 100svh); padding-block: 12px; }
.auth-keyboard-open .auth-card { padding-block: 14px; }
.auth-keyboard-open .auth-brand,
.auth-keyboard-open .auth-handle,
.auth-keyboard-open .auth-emblem,
.auth-keyboard-open .auth-footer { display: none; }
.auth-keyboard-open .auth-heading h1 { font-size: 20px; }
.auth-keyboard-open .auth-heading p { margin: 2px 0 8px; font-size: 13px; }
.auth-keyboard-open .auth-recipient { gap: 0; margin: 0 0 12px; }
.auth-keyboard-open .auth-recipient bdi { font-size: 17px; }
.auth-keyboard-open .auth-recipient a { font-size: 12px; }
.auth-keyboard-open .auth-form { gap: 12px; }
.auth-keyboard-open .auth-resend { min-height: 48px; gap: 0; font-size: 12px; }
.auth-keyboard-open .auth-text-button { min-height: 28px; padding-block: 0; font-size: 12px; }
.auth-keyboard-open .auth-primary { min-height: 46px; padding-block: 8px; font-size: 16px; }
