/* ============================================================================
   ProFaber — ko‘p bosqichli ariza formasi (/ariza/)

   Ranglar, shriftlar va tugmalar `site.css` dan olinadi — bu yerda faqat shu
   sahifaga tegishli qoidalar. Uchala brend motivi saqlanadi: 45° kesim,
   chizg‘ich bo‘linmalari (bosqich ko‘rsatkichi) va to‘q sariq urg‘u.
   ========================================================================== */

.brief-head { max-width: 44rem; }
.brief-head h1 {
  font-size: 1.875rem;
  font-weight: 800;
}
.brief-lede {
  margin-top: 1rem;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--steel);
}

.brief-card {
  margin-top: 2.5rem;
  max-width: 46rem;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 1.75rem 1.5rem 2rem;
}

/* Yashirish uchun yagona sinf — server ham, JS ham shuni qo‘yadi. */
.is-off { display: none !important; }

/* ============================================================================
   1. Bosqich ko‘rsatkichi
   ========================================================================== */

/* Ko‘rsatkich faqat bosqichma-bosqich yurishda ma’noli — JS o‘chiq bo‘lsa
   barcha bosqich baribir ochiq turadi, shuning uchun ko‘rsatkich yashiriladi. */
.brief-prog { display: none; }
.has-js .brief-prog {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.brief-count {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--steel);
  font-variant-numeric: tabular-nums;
}

/* Chizg‘ich bo‘linmalari: o‘tilgan bosqich to‘q sariq, joriysi kengroq. */
.brief-dots {
  display: flex;
  gap: .375rem;
  flex: none;
}
.brief-dot span {
  display: block;
  width: 1.5rem;
  height: 3px;
  background: var(--line);
  transition: background-color .2s, width .2s;
}
.brief-dot.is-done span { background: rgba(238, 100, 20, .45); }
.brief-dot.is-on span { width: 2.5rem; background: var(--accent); }

/* ============================================================================
   2. Bosqichlar
   ========================================================================== */

.brief-step {
  border: 0;
  margin: 0;
  padding: 1.5rem 0 0;
  min-width: 0;   /* fieldset o‘z kengligini oshirib yubormasin */
}
/* JS bor bo‘lsa — bir vaqtda bitta bosqich. JS o‘chiq bo‘lsa hammasi ochiq
   qoladi va forma oddiy bir sahifali forma sifatida ishlaydi. */
.has-js .brief-step { display: none; }
.has-js .brief-step.is-on { display: block; }

.brief-legend {
  display: block;
  padding: 0;
  margin-bottom: .5rem;
}
.brief-legend b {
  display: block;
  font-family: var(--heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brief-legend em {
  display: block;
  margin-top: .25rem;
  font-style: normal;
  font-size: .875rem;
  color: var(--steel);
}

/* Bosqich almashganda kontent yumshoq suriladi — sakrash sezilmasin. */
.has-js .brief-step.is-on { animation: brief-in .22s ease-out both; }
@keyframes brief-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================================
   3. Maydonlar
   ========================================================================== */

.bfield { margin-top: 1.25rem; }

.bfield-label {
  display: block;
  margin-bottom: .5rem;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--steel);
}
.bfield-opt {
  font-style: normal;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(76, 84, 94, .65);
}
.bfield-hint {
  margin-top: .375rem;
  font-size: .8125rem;
  font-style: normal;
  color: rgba(76, 84, 94, .8);
}
.bfield-label .bfield-hint {
  display: inline;
  margin: 0;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.bfield input[type="text"],
.bfield input[type="tel"],
.bfield input[type="email"],
.bfield select,
.bfield textarea {
  width: 100%;
  padding: .75rem .875rem;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 0;
  transition: border-color .18s;
}
.bfield input:focus,
.bfield select:focus,
.bfield textarea:focus {
  border-color: var(--ink);
  outline: none;
}
.bfield textarea { resize: vertical; min-height: 6rem; }

/* Brauzerning o‘z o‘qi qolsin, lekin bo‘shliq maydonga mos bo‘lsin. */
.bfield select { height: 3rem; }

.bfield-err {
  margin-top: .375rem;
  font-size: .8125rem;
  color: #b3341c;
  min-height: 1.1rem;
}
.bfield-err:empty { min-height: 0; }

/* Xato bo‘lgan maydon qirrasi qizaradi — rang yagona belgi emas, matn ham bor. */
.bfield.is-bad input,
.bfield.is-bad select,
.bfield.is-bad textarea { border-color: #b3341c; }
.bfield.is-bad .bopt { border-color: rgba(179, 52, 28, .5); }

/* ============================================================================
   4. Variantlar (radio va checkbox)
   ========================================================================== */

.bopts {
  display: grid;
  gap: .5rem;
}

.bopt {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem .875rem;
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
  transition: border-color .18s, background-color .18s;
}
.bopt:hover { border-color: rgba(36, 41, 47, .35); }

/* Haqiqiy input ko‘rinmaydi, lekin klaviatura uchun joyida qoladi. */
.bopt input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.bopt-mark {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  border: 1px solid rgba(36, 41, 47, .35);
  border-radius: 50%;
  background: var(--white);
  transition: border-color .18s, background-color .18s;
}
.bopt-mark-sq { border-radius: 0; }

.bopt-text { font-size: .9375rem; line-height: 1.4; }

.bopt input:checked ~ .bopt-mark {
  border-color: var(--accent);
  border-width: 5px;
  background: var(--white);
}
.bopt input:checked ~ .bopt-mark-sq {
  border-width: 1px;
  background: var(--accent);
  /* Belgi — CSS bilan chizilgan galochka: qo‘shimcha rasm kerak emas. */
  background-image: linear-gradient(45deg, transparent 46%, #fff 46%, #fff 58%, transparent 58%),
                    linear-gradient(-45deg, transparent 62%, #fff 62%, #fff 74%, transparent 74%);
  background-size: 62% 62%, 100% 100%;
  background-position: 22% 68%, 0 0;
  background-repeat: no-repeat;
}
.bopt:has(input:checked) {
  border-color: var(--accent);
  background: rgba(238, 100, 20, .05);
}
.bopt:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================================================
   5. Pastki tugmalar
   ========================================================================== */

.brief-nav {
  display: flex;
  gap: .75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
/* «Keyingi» o‘ngda turadi — «Orqaga» bo‘lmaganda ham joyi o‘zgarmasin. */
.brief-nav .js-next,
.brief-nav .js-submit { margin-left: auto; }
.brief-nav button[hidden] { display: none; }

/* ============================================================================
   6. Yakuniy ekran
   ========================================================================== */

.brief-done { text-align: center; padding: 2rem 0 1rem; }
.brief-done-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  color: #fff;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}
.brief-done-mark svg { width: 1.75rem; height: 1.75rem; }
.brief-done h2 {
  margin-top: 1.25rem;
  font-size: 1.5rem;
  font-weight: 800;
}
.brief-done p {
  margin-top: .625rem;
  color: var(--steel);
}
.brief-done .btn { margin-top: 1.75rem; }

/* ============================================================================
   7. Kengroq ekranlar
   ========================================================================== */

@media (min-width: 640px) {
  .brief-card { padding: 2rem 2.25rem 2.5rem; }
  .bopts { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 768px) {
  .brief-head h1 { font-size: 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .has-js .brief-step.is-on { animation: none; }
  .brief-dot span { transition: none; }
}
