/* ==========================================================================
   Bilim va malakalarni baholash agentligi — sertifikatlarni tekshirish tizimi
   Rang palitrasi my.uzbmb.uz rasmiy uslubidan olingan (#17776A, #115C52, #FFA800)
   ========================================================================== */

/* ------------------------------------------------------------- 1. Tokenlar */

:root {
    color-scheme: light;

    --brand: #17776a;
    --brand-700: #115c52;
    --brand-500: #1e8c7c;
    --brand-300: #4d9999;
    --brand-100: #e5f3f6;
    --accent: #ffa800;

    --ink: #323232;
    --ink-strong: #1d2b28;
    --muted: #808080;
    --line: #e2e7ea;
    --line-strong: #ccd3d8;

    --bg: #f8f8fa;
    --surface: #ffffff;
    --surface-2: #f2f5f7;

    --ok-bg: #e4f4f0;
    --ok-line: #a8d8ce;
    --ok-ink: #115c52;
    --fail-bg: #fdece8;
    --fail-line: #f8c4b8;
    --fail-ink: #b3301a;
    --danger: #f04828;

    --hero: linear-gradient(135deg, #115c52 0%, #17776a 55%, #3e9c8d 100%);
    --footer: linear-gradient(160deg, #17776a 0%, #0e4c44 100%);
    --captcha-bg: #f2f5f7;

    --shadow: 0 18px 45px rgba(17, 92, 82, .12);
    --shadow-lg: 0 30px 70px rgba(13, 46, 41, .28);
    --ring: 0 0 0 4px rgba(23, 119, 106, .16);

    --radius: 14px;
    --radius-lg: 18px;
}

/* Tizim mavzusi qorong'i bo'lsa (foydalanuvchi yorug'ni tanlamagan bo'lsa) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;

        --brand: #2fa192;
        --brand-700: #1d8073;
        --brand-500: #3bb5a4;
        --brand-300: #5fbdaf;
        --brand-100: #123430;
        --accent: #ffb627;

        --ink: #e6edec;
        --ink-strong: #f4f8f7;
        --muted: #93a5a2;
        --line: #24413e;
        --line-strong: #2e514d;

        --bg: #0d1b1a;
        --surface: #142523;
        --surface-2: #1b2e2c;

        --ok-bg: #10302a;
        --ok-line: #236154;
        --ok-ink: #7fd8c4;
        --fail-bg: #3a1d17;
        --fail-line: #6e2e20;
        --fail-ink: #ff9b82;
        --danger: #ff7a5e;

        --hero: linear-gradient(135deg, #0b2523 0%, #123f39 55%, #17776a 100%);
        --footer: linear-gradient(160deg, #132a27 0%, #0a1615 100%);
        --captcha-bg: #e9efee;

        --shadow: 0 18px 45px rgba(0, 0, 0, .45);
        --shadow-lg: 0 30px 70px rgba(0, 0, 0, .6);
        --ring: 0 0 0 4px rgba(47, 161, 146, .22);
    }
}

/* Foydalanuvchi qo'lda qorong'i mavzuni tanlaganda */
:root[data-theme="dark"] {
    color-scheme: dark;

    --brand: #2fa192;
    --brand-700: #1d8073;
    --brand-500: #3bb5a4;
    --brand-300: #5fbdaf;
    --brand-100: #123430;
    --accent: #ffb627;

    --ink: #e6edec;
    --ink-strong: #f4f8f7;
    --muted: #93a5a2;
    --line: #24413e;
    --line-strong: #2e514d;

    --bg: #0d1b1a;
    --surface: #142523;
    --surface-2: #1b2e2c;

    --ok-bg: #10302a;
    --ok-line: #236154;
    --ok-ink: #7fd8c4;
    --fail-bg: #3a1d17;
    --fail-line: #6e2e20;
    --fail-ink: #ff9b82;
    --danger: #ff7a5e;

    --hero: linear-gradient(135deg, #0b2523 0%, #123f39 55%, #17776a 100%);
    --footer: linear-gradient(160deg, #132a27 0%, #0a1615 100%);
    --captcha-bg: #e9efee;

    --shadow: 0 18px 45px rgba(0, 0, 0, .45);
    --shadow-lg: 0 30px 70px rgba(0, 0, 0, .6);
    --ring: 0 0 0 4px rgba(47, 161, 146, .22);
}

/* ---------------------------------------------------------------- 2. Asos */

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    letter-spacing: -.005em;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color .25s ease, color .25s ease;
}

body.is-modal-open { overflow: hidden; }

main { flex: 1 0 auto; }

h1, h2, h3 {
    letter-spacing: -.022em;
    color: var(--ink-strong);
}

.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 16px;
}

.ico {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ico-fill {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 300;
    padding: 10px 16px;
    background: var(--surface);
    color: var(--brand);
}

.skip-link:focus { left: 0; }

/* -------------------------------------------------------------- 3. Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface);
    border-top: 3px solid var(--brand);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 12px rgba(17, 92, 82, .06);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.brand-logo {
    flex: 0 0 auto;
    width: auto;
    height: 38px;
    color: var(--brand);
}

.brand-text { min-width: 0; }

.brand-sub {
    display: block;
    max-width: 470px;
    font-size: .71rem;
    line-height: 1.25;
    color: var(--muted);
}

.brand-title {
    display: block;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.02em;
    color: var(--brand);
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

/* Mavzu tugmasi */
.theme-toggle {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    color: var(--ink);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    transition: background .18s, color .18s, border-color .18s;
}

.theme-toggle:hover {
    color: var(--brand);
    border-color: var(--brand);
    background: var(--brand-100);
}

.theme-toggle .ico { width: 20px; height: 20px; }
.theme-toggle .icon-dark { display: none; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-light { display: none; }
    :root:not([data-theme="light"]) .theme-toggle .icon-dark { display: block; }
}

:root[data-theme="dark"] .theme-toggle .icon-light { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-dark { display: block; }
:root[data-theme="light"] .theme-toggle .icon-light { display: block; }
:root[data-theme="light"] .theme-toggle .icon-dark { display: none; }

/* Til almashtirgich */
.lang-switch {
    display: inline-flex;
    gap: 2px;
    padding: 4px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.lang-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    transition: background .18s, color .18s;
}

.lang-item:hover { background: var(--brand-100); color: var(--brand); }

.lang-item.is-active {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 4px 10px rgba(17, 119, 106, .28);
}

.lang-flag {
    display: block;
    width: 22px;
    height: 15px;
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .14);
}

/* ---------------------------------------------------------------- 4. Hero */

.hero {
    position: relative;
    padding: 58px 0 124px;
    background: var(--hero);
    color: #fff;
    overflow: hidden;
    /* Pastki chekkasi o'rtada pastga egiladi — karta yashil fon ustida turadi */
    border-bottom-left-radius: 50% 78px;
    border-bottom-right-radius: 50% 78px;
}

.hero::before {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    bottom: -90px;
    left: -80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .05);
}

.hero-pattern {
    position: absolute;
    top: -46px;
    right: -46px;
    width: 300px;
    height: 300px;
    background: url('../img/pattern.svg') no-repeat center / contain;
    opacity: .2;
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-title {
    margin: 0 auto 12px;
    max-width: 780px;
    font-size: clamp(1.55rem, 4vw, 2.45rem);
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
}

.hero-text {
    margin: 0 auto;
    max-width: 620px;
    font-size: clamp(.92rem, 2vw, 1.05rem);
    color: rgba(255, 255, 255, .88);
}

/* --------------------------------------------------------------- 5. Forma */

.form-section {
    position: relative;
    z-index: 2;
    margin-top: -100px;
    padding-bottom: 52px;
}

.card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.form-card {
    max-width: 700px;
    margin: 0 auto;
    padding: 26px 28px 30px;
}

.card-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 18px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.card-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--brand-100);
    color: var(--brand);
}

.card-icon .ico { width: 22px; height: 22px; }

.card-title {
    margin: 0;
    font-size: 1.22rem;
    font-weight: 700;
    color: var(--ink-strong);
}

.card-sub {
    margin: 3px 0 0;
    font-size: .88rem;
    color: var(--muted);
}

.form-row { margin-bottom: 18px; }

.field-label {
    display: block;
    margin-bottom: 7px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--ink);
}

.required .field-label::after {
    content: " *";
    color: var(--danger);
}

.input-wrap { position: relative; }

.input-ico {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.field-input {
    display: block;
    width: 100%;
    height: 50px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: var(--surface);
    border: 1.5px solid var(--line-strong);
    border-radius: 12px;
    transition: border-color .18s, box-shadow .18s, background .18s;
}

.input-ico + .field-input { padding-left: 42px; }

.field-input::placeholder { color: var(--muted); opacity: .75; }

.field-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: var(--ring);
}

.field-error {
    margin-top: 6px;
    font-size: .82rem;
    color: var(--danger);
}

.has-error .field-input { border-color: var(--danger); }

/* To'g'ri to'ldirilgan maydon — yengil yashil ramka */
.has-success .field-input,
.has-success .captcha-box { border-color: var(--brand-300); }

/* JSHSHIR qatori */
.pinfl-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.pinfl-row .input-wrap { flex: 1 1 auto; min-width: 0; }

.pinfl-row .field-input {
    font-variant-numeric: tabular-nums;
    letter-spacing: .06em;
}

.label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.pinfl-counter {
    flex: 0 0 auto;
    margin-bottom: 7px;
    font-size: .78rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

.pinfl-counter.is-full { color: var(--brand); font-weight: 600; }

.passport-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 50px;
    padding: 0 16px;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    color: var(--brand);
    background: var(--brand-100);
    border: 1.5px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .18s, background .18s, transform .15s;
}

.passport-btn:hover { border-color: var(--brand); transform: translateY(-1px); }
.passport-btn .ico { width: 20px; height: 20px; }

/* Captcha */
.captcha-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.captcha-row .input-wrap { flex: 1 1 auto; min-width: 0; }

.captcha-box {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 50px;
    padding: 3px 6px 3px 3px;
    background: var(--captcha-bg);
    border: 1.5px solid var(--line-strong);
    border-radius: 12px;
}

.captcha-img {
    display: block;
    height: 42px;
    border-radius: 9px;
    cursor: pointer;
}

.captcha-refresh {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--brand-700);
    background: transparent;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    transition: background .18s, transform .25s;
}

.captcha-refresh:hover { background: rgba(23, 119, 106, .12); transform: rotate(-90deg); }

/* Tugmalar */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 28px;
    font-family: inherit;
    font-size: .98rem;
    font-weight: 600;
    border: 1.5px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: transform .15s, box-shadow .18s, background .18s;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    box-shadow: 0 8px 18px rgba(17, 119, 106, .28);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(17, 119, 106, .34);
}

.btn-ghost {
    color: var(--muted);
    background: transparent;
    border-color: var(--line-strong);
}

.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }

.btn:disabled { opacity: .7; cursor: not-allowed; transform: none; }

.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.btn.is-loading .spinner { display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Natija */
.result {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-top: 22px;
    padding: 16px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    animation: fade-in .25s ease;
}

.result .ico { width: 26px; height: 26px; }
.result .result-ok,
.result .result-fail { display: none; }

.result.is-success {
    color: var(--ok-ink);
    background: var(--ok-bg);
    border-color: var(--ok-line);
}

.result.is-success .result-ok { display: block; }

.result.is-fail {
    color: var(--fail-ink);
    background: var(--fail-bg);
    border-color: var(--fail-line);
}

.result.is-fail .result-fail { display: block; }

.result-title { display: block; font-size: 1rem; }
.result-text { margin: 3px 0 0; font-size: .9rem; opacity: .92; }

@keyframes fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

/* Afzalliklar */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 900px;
    margin: 34px auto 0;
    padding: 0;
    list-style: none;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 20px 18px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: transform .18s, box-shadow .18s, border-color .18s;
}

.feature:hover {
    transform: translateY(-3px);
    border-color: var(--brand-300);
    box-shadow: 0 10px 24px rgba(17, 92, 82, .12);
}

.feature-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 4px;
    border-radius: 50%;
    background: var(--brand-100);
    color: var(--brand);
}

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.feature-text strong { font-size: .95rem; color: var(--ink-strong); }
.feature-text > span { font-size: .84rem; color: var(--muted); }

/* ------------------------------------------- 6. Pasport yordam oynasi */

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 32, 29, .62);
}

.modal-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 920px;
    max-height: calc(100vh - 32px);
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modal-in .22s ease;
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: none; }
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}

.modal-title { margin: 0; font-size: 1.05rem; font-weight: 700; }

.modal-close {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--muted);
    background: var(--surface-2);
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    transition: background .18s, color .18s;
}

.modal-close:hover { background: var(--fail-bg); color: var(--danger); }

.modal-body {
    padding: 18px 20px 22px;
    overflow-y: auto;
}

.modal-image {
    display: block;
    width: 100%;
    height: auto;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.hint-list {
    display: grid;
    gap: 10px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    font-size: .9rem;
    color: var(--muted);
}

.hint-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.hint-list .ico {
    flex: 0 0 18px;
    margin-top: 3px;
    color: var(--brand);
}

/* -------------------------------------------------------------- 7. Footer */

.site-footer {
    flex-shrink: 0;
    margin-top: auto;
    color: rgba(255, 255, 255, .82);
    background: var(--footer);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1.1fr 1fr 1.1fr;
    gap: 30px;
    padding-top: 44px;
    padding-bottom: 34px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo {
    flex: 0 0 auto;
    width: auto;
    height: 36px;
    color: #fff;
}
.footer-brand strong { display: block; color: #fff; font-size: .97rem; line-height: 1.3; }
.footer-brand span { display: block; font-size: .82rem; opacity: .75; }

.footer-site {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    font-size: .88rem;
    color: var(--accent);
    text-decoration: none;
}

.footer-site:hover { text-decoration: underline; }

.footer-title {
    margin: 0 0 14px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--accent);
}

.footer-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .88rem;
}

.footer-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.footer-list .ico {
    flex: 0 0 18px;
    margin-top: 2px;
    opacity: .85;
}

.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

.socials {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.social {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border-radius: 12px;
    transition: transform .18s, background .18s;
}

.social:hover { transform: translateY(-3px); }
.social--telegram:hover  { background: #229ed9; }
.social--facebook:hover  { background: #1877f2; }
.social--instagram:hover { background: linear-gradient(45deg, #f09433, #dc2743, #bc1888); }
.social--youtube:hover   { background: #ff0000; }

.footer-bottom {
    padding: 15px 0;
    padding-bottom: calc(15px + env(safe-area-inset-bottom));
    font-size: .82rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, .13);
    opacity: .8;
}

/* -------------------------------------------------------- 8. Mobil versiya */

@media (max-width: 1000px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
}

@media (max-width: 768px) {
    body { font-size: 14.5px; }

    .header-inner { padding: 9px 14px; gap: 8px; }
    .brand { gap: 10px; }
    .brand-logo { height: 32px; }
    .brand-sub { display: none; }
    .brand-title { font-size: .86rem; }
    .header-tools { gap: 6px; }
    .theme-toggle { width: 38px; height: 38px; border-radius: 10px; }
    .lang-switch { padding: 3px; }
    .lang-item { padding: 5px 9px; gap: 5px; font-size: .74rem; }
    .lang-flag { width: 20px; height: 14px; }

    .hero {
        padding: 38px 0 104px;
        border-bottom-left-radius: 50% 52px;
        border-bottom-right-radius: 50% 52px;
    }
    .hero-pattern { top: -30px; right: -60px; width: 190px; height: 190px; opacity: .14; }

    .form-section { margin-top: -84px; padding-bottom: 40px; }
    .form-card { padding: 22px 16px 24px; }
    .card-head { gap: 12px; padding-bottom: 16px; margin-bottom: 18px; }
    .card-title { font-size: 1.08rem; }
    .card-sub { font-size: .84rem; }

    .features { grid-template-columns: 1fr; gap: 12px; margin-top: 26px; }
    .feature { flex-direction: row; align-items: center; gap: 14px; text-align: left; padding: 16px; }
    .feature-icon { flex: 0 0 42px; margin-bottom: 0; }

    .modal { padding: 10px; }
    .modal-dialog { max-height: calc(100vh - 20px); }
    .modal-head { padding: 14px 16px; }
    .modal-title { font-size: .98rem; }
    .modal-body { padding: 14px 16px 18px; }
    .hint-list { font-size: .85rem; }
}

@media (max-width: 600px) {
    .footer-grid { grid-template-columns: 1fr; gap: 22px; padding-top: 32px; }
    .footer-title { margin-bottom: 10px; }
}

@media (max-width: 520px) {
    .captcha-row { flex-direction: column-reverse; }
    .captcha-box { height: 56px; justify-content: space-between; }
    .captcha-img { flex: 1 1 auto; width: 100%; height: 48px; object-fit: contain; }
    .form-actions { flex-direction: column; }
    .btn { width: 100%; }
    .pinfl-row { gap: 8px; }
    .passport-btn { padding: 0 14px; }
    .passport-btn span { display: none; }
}

@media (max-width: 400px) {
    .lang-code { display: none; }
    .lang-item { padding: 6px 8px; }
}

/* Harakatni kamaytirish rejimi */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ------------------------------------------------- 9. Ichki sahifalar */

main > .site-error,
main > .site-about,
main > .site-contact,
main > .site-login {
    max-width: 1140px;
    margin: 0 auto;
    padding: 40px 16px 60px;
}

.not-set { color: var(--danger); font-style: italic; }

/* Xato sahifasidagi ogohlantirish bloki (Bootstrap'siz minimal uslub) */
.alert {
    padding: 14px 18px;
    border: 1px solid var(--fail-line);
    border-radius: var(--radius);
    background: var(--fail-bg);
    color: var(--fail-ink);
}

.alert-success {
    border-color: var(--ok-line);
    background: var(--ok-bg);
    color: var(--ok-ink);
}
