@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; --navy: #0B5E93; --tint: #EEF7FD;
  --yellow: #FFC21A; --green: #22C55E; --tg: #229ED9;
  --ink: #0F172A; --ink-2: #334155; --muted: #5B6270; --line: #D9E1EB; --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; }
.accent { color: var(--blue); }

.app { max-width: 440px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; background: #fff; }
@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; }
.spacer { flex: 1; }

.brand { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 22px; font-weight: 900; letter-spacing: -.3px; }
.brand img { display: block; }
.brand-sm { font-size: 20px; }

/* ---------- 1 · Forma ---------- */
.top {
  background: var(--tint); border-radius: 0 0 32px 32px;
  padding: 20px 16px 22px; display: flex; flex-direction: column; align-items: center; gap: 18px;
}
h1 { margin: 0; font-size: 32px; line-height: 1.1; font-weight: 900; letter-spacing: -.7px; text-align: center; }
h1 .accent { display: block; }

.timer {
  width: 100%; background: var(--navy); border-radius: 22px; padding: 14px 14px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  box-shadow: 0 14px 30px rgba(11,94,147,.25);
}
.timer-label {
  display: flex; align-items: center; gap: 8px; color: #fff;
  font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px;
}
.timer-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,194,26,.6); } 70%, 100% { box-shadow: 0 0 0 7px rgba(255,194,26,0); } }
.timer-grid { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 8px; }
.timer-grid i { font-style: normal; font-size: 26px; font-weight: 900; color: rgba(255,255,255,.6); }
.timer-unit {
  background: #fff; border-radius: 16px; padding: 10px 4px 9px;
  display: flex; flex-direction: column; align-items: center; line-height: 1;
}
.timer-unit b { font-size: 34px; font-weight: 900; color: var(--navy); font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.timer-unit span { margin-top: 5px; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.timer.live .timer-grid { display: none; }

.form { padding: 24px 16px 0; display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label, .field .label { font-size: 14px; font-weight: 800; color: var(--ink-2); }
.input {
  width: 100%; height: 54px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff;
  font-size: 16px; font-weight: 700; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input.input { padding: 0 16px; outline: none; }
input.input:focus, .phone-box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(7,150,222,.12); }
::placeholder { color: #9AA3B2; font-weight: 600; }
.input.invalid { border-color: var(--error); }
.phone-box { display: flex; align-items: center; gap: 10px; padding: 0 0 0 16px; }
.phone-box svg { flex-shrink: 0; }
.prefix { font-size: 16px; font-weight: 800; }
.divider { width: 1px; height: 24px; background: var(--line); }
.phone-box input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  font-size: 16px; font-weight: 700; color: var(--ink); padding: 0 16px 0 0;
}
.grades { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.grade {
  height: 50px; padding: 0; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink); font-size: 15px; font-weight: 800;
  transition: background .15s, border-color .15s;
}
.grade[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 6px 14px rgba(7,150,222,.3); }
.grades.invalid .grade[aria-pressed="false"] { border-color: var(--error); }
.err { font-size: 13px; font-weight: 700; color: var(--error); }
.err-submit { margin: 12px 16px 0; text-align: center; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.bottom { padding: 20px 16px calc(clamp(20px, 4vh, 34px) + env(safe-area-inset-bottom)); }
.cta {
  width: 100%; height: 58px; border: 0; border-radius: 16px; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 18px; font-weight: 900; cursor: pointer; text-decoration: none;
  box-shadow: 0 10px 22px rgba(7,150,222,.35); transition: transform .08s, opacity .2s;
}
.cta:active { transform: scale(.98); }
.cta:disabled { opacity: .7; cursor: progress; }
.cta:focus-visible, .grade:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* ---------- 2 · Tabriklaymiz ---------- */
.screen-thanks { padding: 28px 24px calc(40px + env(safe-area-inset-bottom)); align-items: center; text-align: center; }
.thanks-body { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.done { position: relative; z-index: 0; width: 184px; height: 124px; display: flex; align-items: center; justify-content: center; }
/* Zarchalar: tabrik ekrani ochilganda yashil belgi ortidan otilib chiqadi */
.cf {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) translate(var(--x), var(--y)) rotate(var(--r));
  animation: burst .9s cubic-bezier(.12,.75,.3,1) .12s both;
}
.cf-fly { opacity: 0; animation: burst-fly 1.5s cubic-bezier(.12,.75,.3,1) calc(.12s + var(--d, 0s)) both; }
@keyframes burst {
  0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translate(-50%, -50%) translate(var(--x), var(--y)) rotate(var(--r)); opacity: 1; }
}
@keyframes burst-fly {
  0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; }
  8% { opacity: 1; }
  55% { transform: translate(-50%, -50%) translate(var(--x), var(--y)) rotate(var(--r)); opacity: 1; }
  100% { transform: translate(-50%, -50%) translate(var(--x), calc(var(--y) + 60px)) rotate(calc(var(--r) + 180deg)); opacity: 0; }
}
.done-circle {
  position: relative; z-index: 1;
  width: 96px; height: 96px; border-radius: 50%; background: var(--green);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 12px #E3F9EB, 0 16px 32px rgba(34,197,94,.3);
  animation: pop .45s cubic-bezier(.2,1.4,.4,1);
}
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }
.thanks-head { display: flex; flex-direction: column; gap: 10px; align-items: center; }
h2 { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 900; letter-spacing: -.6px; }
.thanks-text { margin: 0; max-width: 300px; font-size: 17px; line-height: 1.55; font-weight: 600; color: var(--muted); }
.thanks-text b { color: var(--ink); }
.line { width: 48px; height: 3px; border-radius: 3px; background: #E3E7EF; margin: 4px 0; }
.tg-text { margin: 0; max-width: 290px; font-size: 15px; line-height: 1.5; font-weight: 700; color: var(--ink-2); }
.cta-telegram { background: var(--tg); box-shadow: 0 10px 22px rgba(34,158,217,.3); }
.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); }

/* Past ekranlar (kichik telefonlar): aylantirmasdan sig'sin */
@media (max-height: 700px) {
  .top { gap: 12px; padding: 14px 16px 16px; }
  h1 { font-size: 27px; }
  .timer { padding: 10px 12px 12px; gap: 8px; }
  .timer-unit { padding: 7px 4px 6px; }
  .timer-unit b { font-size: 26px; }
  .form { padding-top: 16px; gap: 12px; }
  .input { height: 48px; }
  .grade { height: 44px; }
  .bottom { padding-top: 14px; }
  .thanks-body { gap: 16px; }
  .done { transform: scale(.85); margin: -8px 0; }
}
@media (max-width: 350px) { h1 { font-size: 27px; } .grade { font-size: 13px; } .timer-unit b { font-size: 28px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.screen-thanks { overflow: hidden; }
