/* ==========================================================================
   LabVoice — сторінка запису (анкета + оплата) і сторінка результату оплати.
   Базові токени (кольори, шрифти, кнопки, шапка) — у css/style.css.
   ========================================================================== */

.page-register, .page-result { background: var(--bg); }
.page-register .header, .page-result .header { background: rgba(11, 10, 18, .72); }

/* ---------- Розкладка ---------- */
.reg {
  position: relative;
  padding: calc(var(--header-h) + 40px) 0 clamp(72px, 10vw, 140px);
  overflow: hidden;
  min-height: 100vh;
}
.reg__glow {
  position: absolute;
  top: -120px; left: 50%;
  width: 760px; height: 760px;
  margin-left: -380px;
  border-radius: 50%;
  background:
    radial-gradient(closest-side at 40% 40%, var(--accent-2-soft), transparent 70%),
    radial-gradient(closest-side at 65% 60%, var(--accent-soft), transparent 70%);
  filter: blur(40px);
  opacity: .55;
  pointer-events: none;
}
.reg__grid { position: relative; display: grid; gap: 44px; }
.reg__title { margin-top: 16px; font-size: clamp(2.6rem, 8vw, 4.4rem); }
.reg__intro .section-head__sub { margin-top: 18px; }

@media (min-width: 1024px) {
  .reg { padding-top: calc(var(--header-h) + 64px); }
  .reg__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 72px; align-items: start; }
  .reg__intro { position: sticky; top: calc(var(--header-h) + 32px); }
}
@media (min-width: 1240px) { .reg__grid { gap: 104px; } }

/* ---------- Картка курсу ---------- */
.summary {
  margin-top: 32px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
}
.summary__label { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.summary__price { margin-top: 10px; display: flex; align-items: baseline; gap: 10px; }
.summary__sum { font-family: var(--serif); font-size: clamp(3rem, 9vw, 4.2rem); line-height: .9; letter-spacing: -.02em; }
.summary__cur { font-family: var(--serif); font-style: italic; font-size: 1.5rem; color: var(--accent); }
.summary__meta { margin-top: 12px; font-size: 14px; color: var(--muted); }
.summary__list { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 10px; font-size: 14px; }
.summary__list li { display: flex; gap: 12px; align-items: flex-start; }
.summary__list .ico { width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.summary__parts { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: linear-gradient(135deg, var(--accent-2-soft), var(--accent-soft)); font-size: 14px; }
.summary__parts b { color: var(--accent); font-weight: 600; }

.trust { margin-top: 22px; display: grid; gap: 10px; font-size: 13px; color: var(--faint); }
.trust li { display: flex; gap: 10px; align-items: flex-start; }
.trust .ico { width: 18px; height: 18px; color: var(--accent); margin-top: 1px; }
.trust a { color: var(--muted); border-bottom: 1px solid var(--line-2); transition: color .3s, border-color .3s; }
.trust a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Форма ---------- */
.form { display: grid; gap: 40px; }
.form[hidden] { display: none; }

.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 20px; }
.fieldset[hidden] { display: none; }
.fieldset__legend {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 8px;
  padding: 0;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 5vw, 2.3rem);
  line-height: 1.1;
}
.fieldset__legend span { font-family: var(--sans); font-size: 12px; letter-spacing: .14em; color: var(--accent); }

.row { display: grid; gap: 20px; }
@media (min-width: 640px) { .row { grid-template-columns: 1fr 1fr; } }

.field { display: grid; gap: 8px; min-width: 0; align-content: start; }
.field__label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.field__label.req::after, .req-mark { content: " *"; color: var(--accent); font-style: normal; }
.field__control {
  width: 100%;
  min-width: 0;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .3s, box-shadow .3s, background-color .3s;
}
.field__control::placeholder { color: var(--faint); }
.field__control:hover { border-color: var(--line-2); }
.field__control:focus { outline: none; border-color: var(--accent); background: var(--surface-2); box-shadow: 0 0 0 4px var(--accent-soft); }
.field__control:-webkit-autofill { -webkit-text-fill-color: var(--text); -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset; caret-color: var(--text); }
textarea.field__control { resize: vertical; min-height: 120px; }
input[type="number"].field__control { -moz-appearance: textfield; }
input[type="number"].field__control::-webkit-outer-spin-button, input[type="number"].field__control::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field__hint { font-size: 13px; color: var(--faint); }
.field__error { display: none; font-size: 13px; color: #ff8d9a; }
.field.is-invalid .field__control { border-color: rgba(255, 110, 130, .7); box-shadow: 0 0 0 4px rgba(255, 110, 130, .12); }
.field.is-invalid .field__error { display: block; }
.field.is-invalid .pill span, .field.is-invalid .check__box { border-color: rgba(255, 110, 130, .7); }

/* так / ні */
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { position: relative; }
.pill input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pill span {
  display: inline-flex;
  align-items: center;
  min-width: 96px;
  justify-content: center;
  padding: 12px 24px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 15px;
  transition: background-color .3s, color .3s, border-color .3s, box-shadow .3s;
}
.pill:hover span { border-color: var(--text); }
.pill input:checked + span { background: var(--accent-grad); border-color: transparent; color: var(--accent-ink); font-weight: 500; }
.pill input:focus-visible + span { box-shadow: 0 0 0 4px var(--accent-soft); }

/* згода */
.check { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; }
.check input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.check__box {
  flex: none;
  width: 24px; height: 24px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 7px;
  background: var(--surface);
  color: var(--accent-ink);
  transition: background-color .3s, border-color .3s, box-shadow .3s;
}
.check__box .ico { width: 16px; height: 16px; opacity: 0; transform: scale(.6); transition: opacity .25s, transform .3s var(--ease); }
.check input:checked + .check__box { background: var(--accent-grad); border-color: transparent; }
.check input:checked + .check__box .ico { opacity: 1; transform: none; }
.check input:focus-visible + .check__box { box-shadow: 0 0 0 4px var(--accent-soft); }
.check__text { font-size: 14px; color: var(--muted); line-height: 1.5; }
.check__text a { color: var(--text); border-bottom: 1px solid var(--line-2); transition: color .3s, border-color .3s; }
.check__text a:hover { color: var(--accent); border-color: var(--accent); }
.field[data-field="offer"] { margin-top: -6px; }   /* дві галочки поспіль — трохи щільніше */

/* пастка */
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Способи оплати ---------- */
.pay { display: grid; gap: 12px; }
.pay__opt {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px 16px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .35s, background-color .35s, box-shadow .35s;
}
.pay__opt:hover { border-color: var(--line-2); }
.pay__opt.is-selected {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: linear-gradient(135deg, var(--accent-2-soft), var(--accent-soft)), var(--surface);
  box-shadow: 0 20px 50px -30px rgba(123, 92, 250, .5);
}
.pay__opt input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.pay__radio {
  width: 22px; height: 22px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: border-color .3s;
}
.pay__radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-grad); transform: scale(0); transition: transform .3s var(--ease); }
.pay__opt.is-selected .pay__radio { border-color: var(--accent); }
.pay__opt.is-selected .pay__radio::after { transform: scale(1); }
.pay__opt input:focus-visible ~ .pay__radio { box-shadow: 0 0 0 4px var(--accent-soft); }
.pay__body { display: grid; gap: 4px; min-width: 0; }
.pay__title { font-size: 16px; font-weight: 500; }
.pay__desc { font-size: 13px; color: var(--muted); line-height: 1.5; }
.pay__logo { height: 24px; width: auto; opacity: .95; }
.pay__brand {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text);
  white-space: nowrap;
}
.pay__extra { display: none; grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--line); gap: 12px; }
.pay__opt.is-selected .pay__extra { display: grid; }
.pay__legal { font-size: 11.5px; line-height: 1.5; color: var(--faint); }
.pay__legal a { color: var(--muted); border-bottom: 1px solid var(--line-2); }

.parts { display: flex; flex-wrap: wrap; gap: 8px; }
.part { position: relative; }
.part input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.part span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  background: var(--bg);
  transition: background-color .3s, color .3s, border-color .3s, box-shadow .3s;
}
.part span b { font-weight: 600; color: var(--text); }
.part:hover span { border-color: var(--text); }
.part input:checked + span { background: var(--text); border-color: var(--text); color: var(--bg); }
.part input:checked + span b { color: var(--bg); }
.part input:focus-visible + span { box-shadow: 0 0 0 4px var(--accent-soft); }

@media (max-width: 479px) {
  .pay__opt { grid-template-columns: auto minmax(0, 1fr); }
  .pay__logo, .pay__brand { grid-column: 2; justify-self: start; }
}

/* ---------- Підвал форми ---------- */
.form__footer { display: grid; gap: 14px; }
.form__note { font-size: 13px; color: var(--faint); text-align: center; }
.form__legal {                  /* офіційний текст ПЧ — сноска у тому ж стилі, що й примітка під кнопкою */
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--faint);
  text-align: left;
}
.form__legal p { margin: 0; font-size: inherit; color: inherit; }
.form__legal a { color: var(--muted); border-bottom: 1px solid var(--line-2); transition: color .3s, border-color .3s; }
.form__legal a:hover { color: var(--accent); border-color: var(--accent); }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn.is-busy .btn__label { opacity: .75; }

.form__alert {
  padding: 14px 18px;
  border: 1px solid rgba(255, 110, 130, .45);
  border-radius: 14px;
  background: rgba(255, 110, 130, .08);
  color: #ffb3bb;
  font-size: 14px;
  line-height: 1.5;
}
.form__alert[hidden] { display: none; }

.resume {
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-soft);
}
.resume[hidden] { display: none; }
.resume__title { font-weight: 500; }
.resume__title b { color: var(--accent); font-weight: 600; }
.resume__text { margin-top: 4px; font-size: 14px; color: var(--muted); }

/* ---------- Панелі станів ---------- */
.panel {
  position: relative;
  padding: clamp(32px, 6vw, 56px) clamp(22px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(600px circle at 30% 0%, rgba(255, 255, 255, .04), transparent 60%),
    var(--bg-2);
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 18px;
}
.panel[hidden] { display: none; }
.panel--page { max-width: 720px; margin: 0 auto; }
.panel .eyebrow { justify-content: center; }
.panel .eyebrow .num::after { display: none; }
.panel__title { font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 7vw, 3.6rem); line-height: 1; letter-spacing: -.01em; }
.panel__title em { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .08em; }
.panel__text { max-width: 36em; color: var(--muted); line-height: 1.6; }
.panel__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }
.panel__foot { font-size: 13px; color: var(--faint); }
.panel__foot[hidden] { display: none; }
.panel__foot.is-error { color: #ffb3bb; }
.panel__icon {
  width: 72px; height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-ink);
}
.panel__icon .ico { width: 34px; height: 34px; }
.panel__icon--ok { background: var(--accent-grad); box-shadow: 0 20px 50px -20px rgba(38, 217, 201, .6); }
.panel__icon--err { background: linear-gradient(135deg, #ff6b7a, #ff9f6b); box-shadow: 0 20px 50px -20px rgba(255, 107, 122, .6); }

.steps { counter-reset: s; display: grid; gap: 12px; text-align: left; max-width: 34em; }
.steps li { counter-increment: s; display: flex; gap: 14px; align-items: flex-start; color: var(--muted); font-size: 15px; line-height: 1.5; }
.steps li::before {
  content: counter(s);
  flex: none;
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--accent);
}
.steps b { color: var(--text); font-weight: 500; }

.spinner {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Сторінка оферти (oferta.php) ---------- */
.page-legal { background: var(--bg); }
.page-legal .header { background: rgba(11, 10, 18, .72); }
.legal .container { max-width: calc(820px + var(--gutter) * 2); }
.legal__doc { position: relative; }
.legal__title { margin-top: 16px; font-size: clamp(2.3rem, 7vw, 3.9rem); }
.legal__sub { margin-top: 14px; font-family: var(--serif); font-style: italic; font-size: clamp(1.25rem, 3.2vw, 1.65rem); line-height: 1.3; color: var(--muted); }
.legal__meta { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; font-size: 13px; color: var(--faint); }
.legal__meta a { color: var(--muted); border-bottom: 1px solid var(--line-2); transition: color .3s, border-color .3s; }
.legal__meta a:hover { color: var(--accent); border-color: var(--accent); }

.legal__toc {
  margin-top: 36px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  display: grid;
  gap: 10px 28px;
  font-size: 14px;
}
.legal__toc a { display: flex; gap: 12px; align-items: baseline; color: var(--muted); transition: color .3s; }
.legal__toc a span { flex: none; min-width: 1.6em; font-family: var(--serif); font-style: italic; font-size: 16px; color: var(--accent); }
.legal__toc a:hover { color: var(--text); }
@media (min-width: 600px) { .legal__toc { grid-template-columns: 1fr 1fr; } }

.legal__body { margin-top: 44px; display: grid; gap: 40px; }
.legal__body section { padding-top: 28px; border-top: 1px solid var(--line); display: grid; gap: 12px; scroll-margin-top: calc(var(--header-h) + 24px); }
.legal__body h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.55rem, 3.6vw, 2rem); line-height: 1.15; letter-spacing: -.01em; margin-bottom: 6px; }
.legal__body p, .legal__body li { font-size: 15px; line-height: 1.7; color: var(--muted); }
.legal__body ul { display: grid; gap: 6px; padding-left: 22px; list-style: disc; }
.legal__body li::marker { color: var(--accent); }
.legal__body a { color: var(--text); border-bottom: 1px solid var(--line-2); transition: color .3s, border-color .3s; word-break: break-word; }
.legal__body a:hover { color: var(--accent); border-color: var(--accent); }
.legal__req dl { display: grid; gap: 10px; margin: 0; }
.legal__req dl > div { display: grid; gap: 2px; }
.legal__req dt { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.legal__req dd { margin: 0; font-size: 15px; color: var(--text); }
@media (min-width: 600px) {
  .legal__req dl > div { grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: baseline; }
  .legal__req dt { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--muted); }
}
.legal__foot { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--faint); text-align: center; }

.reg--result { display: flex; align-items: center; }
.reg--result .container { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-top-color: var(--line-2); }
}
