:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --ink: #0f1e3d;
  --muted: #5b6b86;
  --line: #e1e8f5;
  --danger: #d92d20;
  --radius: 14px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 380px at 50% -140px, var(--blue-100), rgba(219, 234, 254, 0) 70%),
    #fff;
  background-repeat: no-repeat;
}

.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

main { flex: 1; }

/* ---------- Header ---------- */

.header { padding: 18px 0 6px; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.logo__mark { display: block; }
.logo__text {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ---------- Hero (faqat 1-bosqichda) ---------- */

.hero {
  text-align: center;
  padding: 26px 0 28px;
}
.hero h1 {
  margin: 0;
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.accent { color: var(--blue-600); white-space: nowrap; }

/* ---------- Card ---------- */

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  margin-bottom: 40px;
  box-shadow: 0 18px 50px -20px rgba(37, 99, 235, 0.22);
  scroll-margin-top: 12px;
}
.hero[hidden] + .card { margin-top: 18px; }

/* ---------- Stepper ---------- */

.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}
.stepper li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}
.stepper li:not(:last-child) { flex: 1; }
.stepper li:not(:last-child)::after {
  content: "";
  flex: 1;
  min-width: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--line);
}
.stepper__num {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  transition: background-color 0.15s;
}
.stepper li.is-active { color: var(--ink); }
.stepper li.is-active .stepper__num {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #fff;
}
.stepper li.is-done .stepper__num {
  background: var(--blue-50);
  border-color: var(--blue-600);
  color: var(--blue-600);
}
.stepper li.is-done::after { background: var(--blue-600); }

/* Tugallangan bosqichga qaytish */
.stepper li[role="button"] { cursor: pointer; }
.stepper li[role="button"]:hover .stepper__num { background: var(--blue-100); }
.stepper li[role="button"]:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.4); outline-offset: 3px; border-radius: 999px; }

@media (max-width: 479px) {
  .stepper li:not(.is-active) .stepper__label { display: none; }
}

/* ---------- Steps ---------- */

.step { animation: step-in 0.28s ease both; }
@keyframes step-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.step__title {
  margin: 0 0 20px;
  font-size: 1.375rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.015em;
  outline: none;
}

/* ---------- Form fields ---------- */

.field { margin-bottom: 18px; }
.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 600;
}

input[type="text"],
input[type="tel"] {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  font: inherit;
  font-size: 1rem; /* 16px: iOS yaqinlashtirib yubormasligi uchun */
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: #9aa7bf; }

input[type="text"]:focus,
.phone:focus-within {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.phone {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.phone__prefix {
  padding: 0 14px 0 16px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 49px;
  border-right: 1.5px solid var(--line);
}
.phone input {
  height: 49px;
  border: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: none;
}

.field.has-error input[type="text"],
.field.has-error .phone { border-color: var(--danger); }
.field.has-error input[type="text"]:focus,
.field.has-error .phone:focus-within { box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.12); }

.field__error,
.form-error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 500;
}
.field__error:empty,
.form-error:empty { display: none; }
.form-error { margin: 16px 0 0; text-align: center; }

/* Botlar uchun yashirin maydon */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ---------- Buttons ---------- */

.actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 24px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.985); }
.btn:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.4); outline-offset: 2px; }

.btn--primary {
  flex: 1;
  background: var(--blue-600);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(37, 99, 235, 0.6);
}
.btn--primary:hover { background: var(--blue-700); }

.btn--ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover { background: var(--blue-50); border-color: var(--blue-200); }

/* Katta asosiy tugma (3-bosqich) */
.btn--xl {
  width: 100%;
  height: 62px;
  font-size: 1.1875rem;
  font-weight: 700;
  border-radius: 16px;
  box-shadow: 0 14px 28px -10px rgba(37, 99, 235, 0.65);
}

.btn--block { width: 100%; }

/* Ikkinchi darajali tugma: ramkali, lekin asosiy tugmadan past va tinchroq */
.cta .btn--ghost {
  height: 52px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--blue-700);
  border-color: var(--blue-200);
  box-shadow: 0 2px 6px -2px rgba(37, 99, 235, 0.18);
}
.cta .btn--ghost:hover { background: var(--blue-50); border-color: var(--blue-600); }

.btn:disabled { cursor: default; opacity: 0.7; }
.btn:disabled:active { transform: none; }

.btn__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.is-loading .btn__spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.cta { display: grid; gap: 12px; margin-top: 20px; }
.form-error + .cta { margin-top: 14px; }

/* ---------- Services ---------- */

.services { display: grid; gap: 12px; }

/* Faqat aksiya paketi tanlansa, qolganlari yo'qoladi (Yandex/Google tanlanganda hammasi turadi) */
.services.has-promo-selected .service:not(.is-selected) { display: none; }

.service {
  position: relative;
  display: grid;
  grid-template-columns: 26px 1fr;
  grid-template-areas:
    "check body"
    ".     price";
  column-gap: 14px;
  row-gap: 6px;
  align-items: start;
  padding: 16px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.service:hover { border-color: var(--blue-200); }
.service.is-selected {
  border-color: var(--blue-600);
  background: var(--blue-50);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.service__input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.service__check {
  grid-area: check;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border: 2px solid #c5d2ea;
  border-radius: 8px;
  background: #fff;
  color: #fff;
  transition: background-color 0.15s, border-color 0.15s;
}
.service__check svg { opacity: 0; transform: scale(0.6); transition: opacity 0.15s, transform 0.15s; }
.service.is-selected .service__check { background: var(--blue-600); border-color: var(--blue-600); }
.service.is-selected .service__check svg { opacity: 1; transform: none; }
.service__input:focus-visible ~ .service__check { outline: 3px solid rgba(37, 99, 235, 0.4); outline-offset: 2px; }

.service__body { grid-area: body; display: flex; flex-direction: column; align-items: flex-start; }
.service__title { font-size: 1rem; font-weight: 600; line-height: 1.35; }
.service__desc { margin-top: 3px; color: var(--muted); font-size: 0.875rem; line-height: 1.4; }

.service__price {
  grid-area: price;
  display: flex;
  flex-wrap: wrap; /* tor ekranda chizilgan narx pastga tushadi */
  align-items: baseline;
  column-gap: 10px;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--blue-700);
}
.service__price small { font-size: 0.875rem; font-weight: 600; }
.service__now, .service__old { white-space: nowrap; }
.service__old {
  order: 2;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration-color: var(--blue-600);
  text-decoration-thickness: 2px;
}

/* ---------- Aksiya kartasi ---------- */

.service--promo {
  margin-top: 12px; /* yorliq kartadan yuqoriga chiqib turadi */
  padding-top: 20px;
  border: 2px solid var(--blue-600);
  background: linear-gradient(135deg, var(--blue-100) 0%, var(--blue-50) 55%, #fff 100%);
  box-shadow: 0 14px 30px -14px rgba(37, 99, 235, 0.5);
}
.service--promo:hover { border-color: var(--blue-700); }
.service--promo.is-selected {
  background: linear-gradient(135deg, var(--blue-100) 0%, var(--blue-50) 100%);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18), 0 14px 30px -14px rgba(37, 99, 235, 0.5);
}
.service--promo .service__title { font-size: 1.0625rem; font-weight: 700; }
.service--promo .service__now { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; }
.service--promo .service__now small { font-size: 0.9375rem; }

.ribbon {
  position: absolute;
  top: -13px;
  right: 16px;
  padding: 5px 14px 5px 12px;
  border-radius: 999px;
  background: var(--blue-600);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.2;
  box-shadow: 0 6px 14px -4px rgba(37, 99, 235, 0.6);
  pointer-events: none;
}

@media (min-width: 560px) {
  .service {
    grid-template-columns: 26px 1fr auto;
    grid-template-areas: "check body price";
    align-items: center;
  }
  .service__check { margin-top: 0; }
  .service__price { flex-direction: column; flex-wrap: nowrap; align-items: flex-end; }
  .service__old { order: 0; font-size: 0.875rem; }
}

/* ---------- Summary ---------- */

.summary {
  border: 1px solid var(--blue-100);
  background: var(--blue-50);
  border-radius: 16px;
  padding: 16px 18px;
}
.summary__meta { margin: 0; display: grid; gap: 10px; }
.summary__meta div { display: flex; justify-content: space-between; gap: 16px; font-size: 0.9375rem; }
.summary__meta dt { color: var(--muted); }
.summary__meta dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }

.summary__items {
  margin: 14px 0 0;
  padding: 14px 0 0;
  list-style: none;
  border-top: 1px dashed var(--blue-200);
  display: grid;
  gap: 10px;
}
.summary__items li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  font-size: 0.9375rem;
}
.summary__items .name { font-weight: 500; }
.summary__items .price { font-weight: 600; white-space: nowrap; }

.summary__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--blue-200);
  font-weight: 600;
}
.summary__total strong { font-size: 1.5rem; font-weight: 800; color: var(--blue-700); letter-spacing: -0.01em; }

/* ---------- Yakuniy ekran ---------- */

.done { text-align: center; padding: 12px 0 8px; }
.done .step__title { margin-bottom: 0; }
.done__icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  color: var(--blue-600);
}
.done__text { margin: 10px auto 0; max-width: 360px; color: var(--muted); }
.done__text strong { color: var(--ink); white-space: nowrap; }

/* ---------- Footer ---------- */

.footer {
  padding: 20px 0 32px;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

/* ---------- Kengroq ekranlar ---------- */

@media (min-width: 640px) {
  .header { padding-top: 26px; }
  .hero { padding: 40px 0 36px; }
  .card { padding: 32px; }
}

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