/* ═══════════════════════════════════════════════════════════
   Digital Academy — Test Platforma
   Dizayn tizimi — logo ranglariga moslangan (ko'k gradient)
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Brend ranglari (logodan) ────────────────────────── */
  --brand-950: #021631;
  --brand-900: #03244d;
  --brand-800: #03366f;
  --brand-700: #044182;
  --brand-600: #044c98;
  --brand-500: #1060b8;
  --brand-400: #3d82d6;
  --brand-300: #7db0e8;
  --brand-100: #dceaf8;
  --brand-50:  #eef5fc;

  /* ── Neytral ─────────────────────────────────────────── */
  --ink:        #16233a;
  --ink-soft:   #4a566b;
  --ink-faint:  #7c8698;
  --paper:      #f4f6fa;
  --surface:    #ffffff;
  --surface-2:  #f8fafd;
  --rule:       #dde3ec;
  --rule-soft:  #eaeef4;

  /* ── Semantik ────────────────────────────────────────── */
  --accent:     var(--brand-600);
  --accent-bg:  var(--brand-50);
  --amber:      #b26a00;
  --amber-bg:   #fdf3e2;
  --green:      #0d7355;
  --green-bg:   #e2f5ee;
  --red:        #b02c2c;
  --red-bg:     #fbeaea;

  --radius:     10px;
  --radius-lg:  16px;
  --radius-sm:  7px;

  --shadow-sm:  0 1px 3px rgba(2,22,49,.06), 0 1px 2px rgba(2,22,49,.04);
  --shadow:     0 4px 16px rgba(2,22,49,.08), 0 2px 6px rgba(2,22,49,.05);
  --shadow-lg:  0 12px 34px rgba(2,22,49,.14);

  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", "Inter", sans-serif;

  --grad-brand: linear-gradient(135deg, var(--brand-800) 0%, var(--brand-600) 100%);
  --grad-hero:  radial-gradient(circle at 50% 40%, var(--brand-600) 0%, var(--brand-900) 100%);
}

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Tipografiya ─────────────────────────────────────────── */
h1 { font-size: 23px; font-weight: 650; letter-spacing: -0.02em; }
h2 { font-size: 17px; font-weight: 620; letter-spacing: -0.01em; }
h3 { font-size: 15px; font-weight: 600; }

.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--brand-500); font-weight: 500;
}
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ── Layout ──────────────────────────────────────────────── */
.shell { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.shell--narrow { max-width: 780px; }

.topbar {
  background: var(--surface); border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 40; box-shadow: var(--shadow-sm);
}
.topbar__inner {
  max-width: 1120px; margin: 0 auto; padding: 0 22px;
  height: 62px; display: flex; align-items: center; gap: 16px;
}
.topbar__brand {
  display: flex; align-items: center; gap: 11px;
  font-weight: 640; font-size: 15px; color: var(--ink);
  text-decoration: none; letter-spacing: -0.01em;
}
.topbar__logo {
  width: 34px; height: 34px; border-radius: 9px;
  object-fit: cover; box-shadow: var(--shadow-sm);
}
.topbar__spacer { flex: 1; }
.topbar__user {
  font-size: 13px; color: var(--ink-soft);
  display: flex; align-items: center; gap: 7px;
}
.topbar__user::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
}

/* ── Kartochka ───────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm);
}
.card--flat { background: var(--surface-2); border-color: var(--rule-soft); box-shadow: none; }
.card__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}

/* ── Tugmalar ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font-family: var(--sans); font-size: 14px; font-weight: 550;
  cursor: pointer; text-decoration: none;
  transition: all .15s cubic-bezier(.2,.8,.2,1); white-space: nowrap;
}
.btn:hover  { background: var(--surface-2); border-color: var(--brand-300); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn--primary {
  background: var(--grad-brand); border-color: transparent; color: #fff;
  box-shadow: 0 2px 8px rgba(4,76,152,.28);
}
.btn--primary:hover { box-shadow: 0 4px 14px rgba(4,76,152,.38); filter: brightness(1.06); }
.btn--danger { color: var(--red); border-color: #e6bcbc; background: var(--surface); }
.btn--danger:hover { background: var(--red-bg); border-color: var(--red); }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--ghost:hover { background: var(--brand-50); }
.btn--sm { height: 34px; padding: 0 13px; font-size: 13px; }
.btn--lg { height: 50px; padding: 0 26px; font-size: 15px; }
.btn--block { width: 100%; }

/* ── Formalar ────────────────────────────────────────────── */
label.field { display: block; margin-bottom: 15px; }
label.field > span {
  display: block; font-size: 13px; font-weight: 550;
  color: var(--ink); margin-bottom: 6px;
}
input[type="text"], input[type="password"], input[type="number"],
input[type="tel"], select, textarea {
  width: 100%; height: 42px; padding: 0 13px;
  border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--surface-2); color: var(--ink);
  font-family: var(--sans); font-size: 14px;
  outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { height: auto; padding: 11px 13px; min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3.5px rgba(16,96,184,.14);
  background: var(--surface);
}
input.is-error { border-color: var(--red); box-shadow: 0 0 0 3.5px rgba(176,44,44,.11); }
.field__hint { font-size: 12px; color: var(--ink-faint); margin-top: 5px; }

/* ── Xabarlar ────────────────────────────────────────────── */
.alert {
  padding: 12px 15px; border-radius: var(--radius);
  font-size: 13.5px; line-height: 1.5; border: 1px solid;
  display: flex; gap: 9px; align-items: flex-start;
}
.alert--danger  { background: var(--red-bg);   color: var(--red);   border-color: #eec4c4; }
.alert--warning { background: var(--amber-bg); color: var(--amber); border-color: #ecd6a6; }
.alert--success { background: var(--green-bg); color: var(--green); border-color: #b9e0d1; }
.alert--info    { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 20px);
  background: var(--brand-900); color: #fff; padding: 12px 20px;
  border-radius: var(--radius); font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s; z-index: 100;
  max-width: 90vw; box-shadow: var(--shadow-lg);
}
.toast--show   { opacity: 1; transform: translate(-50%, 0); }
.toast--danger { background: var(--red); }
.toast--success{ background: var(--green); }

/* ── Yorliqlar ───────────────────────────────────────────── */
.tag {
  display: inline-block; padding: 2.5px 9px; border-radius: 20px;
  font-family: var(--mono); font-size: 11px; font-weight: 550; letter-spacing: .03em;
}
.tag--d1 { background: var(--green-bg);  color: var(--green); }
.tag--d2 { background: #e6f1e0;          color: #43701a; }
.tag--d3 { background: var(--brand-50);  color: var(--brand-600); }
.tag--d4 { background: var(--amber-bg);  color: var(--amber); }
.tag--d5 { background: var(--red-bg);    color: var(--red); }

.pill { display:inline-block; padding:2.5px 9px; border-radius:5px; font-size:11px;
        font-family: var(--mono); background: var(--surface-2); border:1px solid var(--rule);
        color: var(--ink-soft); }
.pill--admin   { background: var(--red-bg);    color: var(--red);    border-color:#eec4c4; }
.pill--teacher { background: var(--brand-50);  color: var(--brand-600); border-color:var(--brand-100); }
.pill--student { background: var(--surface-2); color: var(--ink-soft); }

/* ── Jadval ──────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; padding: 10px 11px;
  font-family: var(--mono); font-size: 11px; font-weight: 550;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-faint); border-bottom: 1.5px solid var(--rule);
}
td { padding: 12px 11px; border-bottom: 1px solid var(--rule-soft); }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }

/* ── Yuklanmoqda ─────────────────────────────────────────── */
.spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.spinner--dark { border-color: rgba(4,76,152,.2); border-top-color: var(--brand-600); }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--rule-soft) 25%, #f1f4f9 50%, var(--rule-soft) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.center { text-align: center; }

/* ── Animatsiyalar ───────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .35s cubic-bezier(.2,.8,.2,1); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
