/* ============================================================
   ASOS — «Yumshoq oq» kit (DESIGN_sections.md)

   Hero va header bu kitga kirmaydi: ular o'z shrifti va shaklida qoladi
   (pastdagi "Hero/header pin" bloklari shuni ta'minlaydi).

   Kit qoidalari:
   1. Bir sahifada bittadan ortiq qizil asosiy tugma bo'lmasin.
   2. Kartalar chegara bilan emas, soya bilan ajratiladi.
      border faqat inputlarda va section chegarasida.
   3. Hover'da karta 4px ko'tariladi va soyasi kuchayadi — boshqa effekt yo'q.
   4. Radiuslar aralashtirilmaydi: button/chip = pill, karta = 22px, input = 14px.
   5. Mayda uppercase yorliqlar har doim --muted.
   ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + var(--float-top) + 16px);
}

body {
    font-family: var(--font-kit);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Hero/header pin: avvalgi shriftida qoladi ---------- */
.site-header,
.hero {
    font-family: var(--font-main);
}

/* Kontent kam bo'lsa ham footer ekranning pastida turadi */
body:not(.admin-body):not(.login-page) {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
}

body:not(.admin-body):not(.login-page) > main {
    flex: 1 0 auto;
}

/* ---------- Sarlavhalar: og'ir, zich ---------- */
h1, h2, h3, h4 {
    font-family: var(--font-kit);
    font-weight: 700;
    color: var(--ink);
}

h1 {
    font-size: clamp(30px, 4vw, 40px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

h3 {
    font-size: 18px;
    line-height: 1.3;
}

h4 {
    font-size: 15px;
    line-height: 1.3;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Matn ichidagi havolalar ko'k */
p a:not(.btn) {
    color: var(--blue-ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}

p a:not(.btn):hover {
    color: var(--ink);
}

button, input, select, textarea {
    font-family: inherit;
}

/* Hero'dagi monoshrift yo'l uchun (hero'dan tashqarida ishlatilmaydi) */
.mono {
    font-family: var(--font-mono);
    font-size: var(--text-body-sm);
    letter-spacing: 0.28px;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-pad);
}

/* ============================================================
   Kit: yorliqlar
   ============================================================ */
.eyebrow {
    font: 700 10px/1 var(--font-kit);
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--muted);
}

.h2 {
    margin: 0;
    font: 800 32px/1 var(--font-kit);
    letter-spacing: -.02em;
    color: var(--ink);
}

/* ============================================================
   Bo'lim sarlavhasi (kit 3.1): badge + h2, yonida statistika kartasi
   ============================================================ */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
    margin-bottom: 46px;
}

.section-head__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    max-width: 640px;
}

.section-head--center {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.section-head--center .section-head__text {
    align-items: center;
}

/* Sarlavha ustidagi badge */
.section-label {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 7px 14px;
    border-radius: var(--r-pill);
    background: var(--red-tint);
    color: var(--red-ink);
    font: 700 10px/1 var(--font-kit);
    letter-spacing: .2em;
    text-transform: uppercase;
}

.section-title {
    margin: 0 0 20px;
    font: 800 clamp(26px, 3.4vw, 32px)/1.05 var(--font-kit);
    letter-spacing: -.02em;
    color: var(--ink);
}

.section-head .section-title {
    margin: 0;
}

/* Sarlavha ichidagi ajratilgan so'z */
.section-title em {
    font-style: normal;
    color: var(--red);
}

.section-lead {
    font-size: 15px;
    line-height: 1.65;
    color: var(--body);
    max-width: 560px;
    text-wrap: pretty;
}

/* Statistika kartasi */
.stat-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 18px 24px;
    border-radius: var(--r-acc);
    background: var(--surface);
    box-shadow: var(--sh-card);
}

.stat-card__value {
    font: 800 24px/1 var(--font-kit);
    color: var(--ink);
}

/* ============================================================
   Tugmalar (kit 3.2): pill, 700 14px
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 26px;
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--ink);
    font: 700 14px/1 var(--font-kit);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .18s, box-shadow .18s, border-color .18s,
                color .18s, transform .1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

/* Qizil asosiy: sahifada bittagina */
.btn--primary {
    background: var(--red);
    color: #ffffff;
    box-shadow: var(--sh-red);
}

.btn--primary:hover {
    background: var(--red-hover);
    color: #ffffff;
}

/* Oq, soyali */
.btn--white {
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--sh-btn);
}

.btn--white:hover {
    box-shadow: var(--sh-btn-hover);
}

/* Ghost: chegarali (eski .btn--outline shu uslubga o'tadi) */
.btn--ghost,
.btn--outline {
    background: transparent;
    color: var(--ink-2);
    border-color: var(--border-strong);
}

.btn--ghost:hover,
.btn--outline:hover {
    border-color: var(--ink);
    color: var(--ink);
}

/* Yumshoq qizil: karta ichidagi ikkinchi darajali harakatlar */
.btn--soft {
    padding: 10px 18px;
    background: var(--red-tint);
    color: var(--red-ink);
    font-size: 12px;
}

.btn--soft:hover {
    background: var(--red-tint-2);
    color: var(--red-ink);
}

.btn--sm,
.btn--pill {
    padding: 10px 18px;
    font-size: 12px;
}

/* Matnli havola-tugma */
.btn--text {
    padding: 4px 0;
    background: none;
    box-shadow: none;
    border-radius: 0;
    color: var(--blue-ink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn[disabled],
.btn:disabled,
.btn[aria-disabled="true"] {
    background: var(--surface-2);
    color: var(--disabled-text);
    border-color: transparent;
    box-shadow: none;
    cursor: not-allowed;
}

/* ---------- Hero pin: hero tugmalari avvalgi shaklida qoladi ---------- */
.hero .btn {
    min-height: 44px;
    gap: var(--space-sm);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: var(--text-body-sm);
    font-weight: 500;
    line-height: 1.4;
    box-shadow: none;
    transition: background var(--transition-fast),
                color var(--transition-fast),
                border-color var(--transition-fast),
                transform 0.1s var(--ease-out);
}

.hero .btn--accent {
    padding-left: 22px;
    padding-right: 20px;
}

/* ============================================================
   Badge va chip
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--r-pill);
    background: var(--red-tint);
    color: var(--red-ink);
    font: 700 10px/1 var(--font-kit);
    letter-spacing: .2em;
    text-transform: uppercase;
}

.chip,
.badge--outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border: 0;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    color: var(--ink-2);
    font: 600 11px/1.2 var(--font-kit);
    letter-spacing: 0;
    text-transform: none;
}

/* ============================================================
   Kartalar (kit 3.3)
   ============================================================ */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 26px;
    border-radius: var(--r-card);
    background: var(--surface);
    box-shadow: var(--sh-card);
    transition: transform .2s, box-shadow .2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--sh-card-hover);
}

.card--accent {
    background: var(--red-card);
    box-shadow: 0 14px 34px rgba(244, 43, 76, .14);
}

.card--accent .chip {
    background: #ffffff;
    color: var(--red-ink);
}

.card__icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: var(--r-icon);
    background: var(--blue-tint);
    color: var(--blue-ink);
}

.card__icon svg {
    width: 20px;
    height: 20px;
}

.card--accent .card__icon {
    background: var(--red);
    color: #ffffff;
}

.card__title {
    font: 700 18px/1.3 var(--font-kit);
    color: var(--ink);
}

.card__body {
    font: 400 13px/1.65 var(--font-kit);
    color: var(--body);
    text-wrap: pretty;
}

.card__meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============================================================
   Steps (kit 3.4)
   ============================================================ */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.step {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px;
    border-radius: var(--r-card);
    background: var(--surface);
    box-shadow: var(--sh-soft);
    color: var(--ink);
}

.step--active {
    background: var(--red-card);
    box-shadow: none;
}

.step__num {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: var(--r-step);
    background: var(--surface-2);
    color: var(--ink-2);
    font: 800 14px/1 var(--font-kit);
}

.step--active .step__num {
    background: var(--red);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(244, 43, 76, .3);
}

.step__title {
    font: 700 15px/1.3 var(--font-kit);
    color: var(--ink);
}

.step__text {
    font: 400 12px/1.55 var(--font-kit);
    color: var(--body);
}

/* ============================================================
   Progress (kit 3.6)
   ============================================================ */
.panel {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 26px;
    border-radius: var(--r-card);
    background: var(--surface);
    box-shadow: var(--sh-card);
}

.bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bar__head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font: 600 13px/1 var(--font-kit);
    color: var(--ink-2);
}

.bar__head b {
    color: var(--ink);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.bar__track {
    height: 10px;
    border-radius: var(--r-pill);
    background: var(--track);
    overflow: hidden;
}

.bar__fill {
    height: 100%;
    border-radius: var(--r-pill);
    background: linear-gradient(90deg, var(--blue), var(--blue-light));
    transition: width .8s var(--ease-out);
}

.bar__fill--red {
    background: linear-gradient(90deg, var(--red), #FF7C92);
}

.total {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-top: 20px;
    border-top: 1px solid var(--divider);
}

.total:first-child {
    padding-top: 0;
    border-top: 0;
}

.total__text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.total__title {
    font: 700 15px/1.2 var(--font-kit);
    color: var(--ink);
}

.total__sub {
    font: 400 12px/1.5 var(--font-kit);
    color: var(--body);
}

.donut {
    width: 80px;
    height: 80px;
    flex: 0 0 auto;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--red) 0% var(--p, 68%), var(--track) var(--p, 68%) 100%);
}

.donut__hole {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--surface);
    display: grid;
    place-items: center;
    font: 800 15px/1 var(--font-kit);
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   Accordion (kit 3.7): <details>, JS kerak emas
   ============================================================ */
.acc {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.acc__item {
    border-radius: var(--r-acc);
    background: var(--surface);
    box-shadow: var(--sh-soft);
}

.acc__item summary {
    list-style: none;
}

.acc__item summary::-webkit-details-marker {
    display: none;
}

.acc__btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: 700 15px/1.35 var(--font-kit);
    text-align: left;
    cursor: pointer;
}

.acc__btn--static {
    cursor: default;
}

.acc__btn:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: -4px;
    border-radius: var(--r-acc);
}

.acc__sign {
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--track);
    color: var(--ink-2);
    font: 700 15px/1 var(--font-kit);
    transition: background .18s, color .18s;
}

.acc__item[open] .acc__sign {
    background: var(--red);
    color: #ffffff;
    font-size: 0;
}

.acc__item[open] .acc__sign::before {
    content: '−';
    font-size: 15px;
}

.acc__body {
    padding: 0 22px 22px;
    font: 400 13px/1.7 var(--font-kit);
    color: var(--body);
}

/* ============================================================
   Formalar (kit 3.8): .form-row = kitdagi .field
   ============================================================ */
.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 28px;
    border-radius: var(--r-form);
    background: var(--surface);
    box-shadow: var(--sh-form);
}

.form-row,
.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.form .form-row,
.form .field {
    margin-bottom: 0;
}

.form-row label,
.field > label {
    font: 600 12px/1 var(--font-kit);
    color: var(--ink-2);
}

.form-row input,
.form-row textarea,
.form-row select,
.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--r-input);
    background: var(--bg);
    color: var(--ink);
    font: 500 14px/1.5 var(--font-kit);
    outline: none;
    transition: border-color .18s, background .18s;
}

.form-row input,
.form-row select,
.field input,
.field select {
    line-height: 1.2;
}

.form-row textarea,
.field textarea {
    min-height: 110px;
    resize: vertical;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--blue);
    background: var(--surface);
}

.form-row input::placeholder,
.form-row textarea::placeholder,
.field input::placeholder,
.field textarea::placeholder {
    color: var(--placeholder);
}

/* Checkbox/radio kenglikni egallamaydi */
.form-row input[type="checkbox"],
.form-row input[type="radio"] {
    width: auto;
    padding: 0;
    accent-color: var(--red);
}

/* ============================================================
   Xabarlar: yumshoq tint, chegarasiz
   ============================================================ */
.alert {
    padding: 14px 18px;
    border-radius: var(--r-input);
    margin-bottom: 16px;
    font: 600 13px/1.5 var(--font-kit);
}

.alert--success {
    background: var(--green-tint);
    color: var(--green);
}

.alert--error {
    background: var(--red-tint);
    color: var(--red-ink);
}

/* ============================================================
   Yordamchi sinflar
   ============================================================ */
.text-muted { color: var(--muted); }
.text-sm    { font-size: 13px; }

.divider {
    height: 1px;
    background: var(--divider);
    border: none;
    margin: 24px 0;
}

/* Media ustidagi yorliq (video, taqdimot) */
.media-tag {
    position: absolute;
    left: 12px;
    top: 12px;
    padding: 5px 11px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .92);
    font: 600 11px/1 var(--font-kit);
    color: var(--ink);
}

/* ---------- Sahifa sarlavhasi ---------- */
.page-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 24px 0 8px;
    margin-bottom: 40px;
}

.page-head h1 {
    font: 800 clamp(30px, 4vw, 40px)/1.05 var(--font-kit);
    letter-spacing: -.02em;
}

.page-head p {
    font-size: 15px;
    line-height: 1.65;
    color: var(--body);
    max-width: 640px;
    text-wrap: pretty;
}

/* Orqaga qaytish: chip ko'rinishida */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    font: 600 12px/1 var(--font-kit);
    color: var(--ink-2);
    transition: background .18s, color .18s;
}

.back-link:hover {
    background: var(--border-strong);
    color: var(--ink);
}

/* Bo'sh holat: yumshoq karta */
.empty-state {
    padding: 40px 24px;
    text-align: center;
    color: var(--muted);
    font-weight: 500;
    background: var(--surface);
    border-radius: var(--r-card);
    box-shadow: var(--sh-soft);
}

/* ---------- Scroll bilan paydo bo'lish ---------- */
[data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

[data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

[data-reveal][style*="--delay"] {
    transition-delay: var(--delay);
}

/* ---------- Chiziqli ikonkalar ---------- */
.ico {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    :root {
        --container-pad: 24px;
        --float-inset: 12px;
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 48px;
        --container-pad: 20px;
        --float-inset: 8px;
    }

    h1 { font-size: 28px; }
    h2 { font-size: 26px; }

    .section-head {
        margin-bottom: 32px;
    }

    .page-head {
        margin-bottom: 28px;
    }
}

/* Harakatni kamaytirish sozlamasi */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .btn:active,
    .card:hover {
        transform: none;
    }

    .card,
    .bar__fill {
        transition: none;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
