@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 500 900;
  font-display: swap;
  src: url('assets/nunito-latin.woff2') format('woff2');
}

:root {
  --blue: #0796DE;
  --blue-dark: #0369A1;
  --yellow: #FFC21A;
  --green: #22C55E;
  --green-soft: #DCFCE7;
  --ink: #16181D;
  --ink-2: #3F4654;
  --muted: #5B6270;
  --line: #E3E7EF;
  --soft: #F2F4FA;
  --pill-bg: #DDF1FD;
  --error: #B91C1C;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: #EEF1F6;
  color: var(--ink);
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input { font-family: inherit; }

[hidden] { display: none !important; }

/* Telefon kengligidagi ustun; kompyuterda markazda turadi */
.app {
  max-width: 440px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: #fff;
  position: relative;
}

@media (min-width: 480px) {
  .app { box-shadow: 0 0 0 1px rgba(16, 24, 40, .04), 0 10px 40px rgba(16, 24, 40, .08); }
}

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
  animation: fadeIn .25s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.spacer { flex: 1; }
.accent { color: var(--blue); }

/* ---------- Top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; }

.brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 24px; font-weight: 900; letter-spacing: -.4px;
  color: var(--ink); text-decoration: none;
}
.brand-sm { gap: 6px; font-size: 20px; letter-spacing: 0; }
.logo { display: block; flex-shrink: 0; }

.back {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.topbar-gap { width: 44px; }

/* ---------- Hero ---------- */
.hero {
  background: var(--soft);
  border-radius: 28px;
  padding: 18px 16px 0;
  display: flex; flex-direction: column; gap: 12px;
  overflow: hidden;
}

.pill {
  align-self: flex-start;
  display: flex; align-items: center; gap: 8px;
  background: var(--pill-bg); color: var(--blue-dark);
  border-radius: 999px; padding: 6px 12px 6px 6px;
  font-size: 11px; font-weight: 800; line-height: 1.25;
  text-transform: uppercase; letter-spacing: .2px;
}
.pill-icon {
  width: 22px; height: 22px; border-radius: 50%; background: var(--blue);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

h1 {
  margin: 0; font-size: 33px; line-height: 1.08; font-weight: 900; letter-spacing: -.6px;
}
.lead {
  margin: 0; font-size: 15px; line-height: 1.45; font-weight: 600; color: var(--ink-2);
}

.hero-photo { position: relative; margin: 0 -16px; height: 200px; }
.hero-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 30% 40%;
}

.badge {
  position: absolute; left: 14px; background: #fff;
  box-shadow: 0 8px 20px rgba(16, 24, 40, .12);
  display: flex; align-items: center;
}
.badge-time { bottom: 16px; border-radius: 14px; padding: 7px 11px; gap: 6px; font-size: 12px; font-weight: 800; }

/* ---------- Maktablar ---------- */
.schools {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
}
.schools li {
  border: 1px solid var(--line); border-radius: 16px; padding: 10px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center; font-size: 12px; font-weight: 800; line-height: 1.2;
}
.school-icon {
  width: 34px; height: 34px; border-radius: 50%; background: var(--green);
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Asosiy tugma ---------- */
.cta {
  width: 100%; min-height: 60px; border: 0; border-radius: 999px;
  background: var(--blue); color: #fff;
  font-size: 19px; font-weight: 900; cursor: pointer;
  box-shadow: 0 5px 0 var(--blue-dark);
  transition: transform .08s ease, box-shadow .08s ease, opacity .2s;
}
.cta:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--blue-dark); }
.cta:disabled { opacity: .7; cursor: progress; }
.cta:focus-visible, .back:focus-visible, .grade:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* Past ekranlarda ham tugma doim ko'rinib turadi */
.cta-arrow {
  position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 1;
  min-height: 62px; display: flex; align-items: center; gap: 14px;
  padding: 7px 24px 7px 7px; text-align: left;
}
.cta-circle {
  width: 48px; height: 48px; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ---------- Ariza ---------- */
.form-title {
  margin: 2px 0 0; font-size: 25px; line-height: 1.18; font-weight: 900; letter-spacing: -.3px;
}
.form-sub { margin: -4px 0 0; font-size: 14px; line-height: 1.4; font-weight: 600; color: var(--muted); }

.form-card {
  background: var(--soft); border-radius: 24px; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 12px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field label, .field .label { font-size: 14px; font-weight: 800; }

.input {
  min-height: 48px; width: 100%;
  border-radius: 14px; border: 2px solid var(--line); background: #fff;
  font-size: 16px; font-weight: 700; color: var(--ink);
}
input.input { padding: 0 14px; outline-color: var(--blue-dark); }
.input.invalid { border-color: var(--error); }

.phone-box { display: flex; align-items: center; gap: 8px; padding: 0 0 0 12px; }
.phone-box:focus-within { border-color: var(--blue-dark); }
.phone-box svg { flex-shrink: 0; }
.prefix { font-size: 16px; font-weight: 800; }
.phone-box input {
  flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent;
  font-size: 16px; font-weight: 700; color: var(--ink); padding: 0 12px 0 0; outline: none;
}

.grades { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.grade {
  min-height: 46px; border-radius: 14px; font-size: 14px; font-weight: 800; cursor: pointer;
  border: 2px solid var(--line); background: #fff; color: var(--ink);
}
.grade[aria-pressed="true"] { border-color: var(--blue-dark); background: var(--blue-dark); color: #fff; }
.grades.invalid .grade[aria-pressed="false"] { border-color: var(--error); }

.err { font-size: 13px; font-weight: 700; color: var(--error); }
.err-submit { margin: 0; text-align: center; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Rahmat ---------- */
.screen-thanks {
  align-items: center; justify-content: center; text-align: center;
  padding: 32px 20px; gap: 16px;
}
.done-circle {
  width: 116px; height: 116px; border-radius: 50%; background: var(--green);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 14px var(--green-soft);
  margin-bottom: 8px;
  animation: pop .4s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

.thanks-title { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 900; letter-spacing: -.4px; }
.thanks-text { margin: 0; font-size: 16px; line-height: 1.5; font-weight: 600; color: var(--ink-2); max-width: 320px; }
.thanks-text b { color: var(--ink); white-space: nowrap; }
.thanks-chip { background: var(--soft); border-radius: 18px; padding: 14px 18px; font-size: 14px; font-weight: 800; }
.thanks-warn { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.thanks-warn p { margin: 0; font-size: 15px; line-height: 1.45; font-weight: 700; color: var(--error); }

/* Juda kichik ekranlar (iPhone SE 1-avlod va h.k.) */
@media (max-width: 350px) {
  h1 { font-size: 28px; }
  .schools li { font-size: 11px; }
  .cta, .cta-arrow { font-size: 17px; }
}

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