/* ===== Страница /epd-kontur — стили ограничены .epd-shell ===== */
@import url("https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700&display=swap");

.epd-shell {
  --blue: #1a73e8; --blue-700: #0b57d0; --blue-50: #e8f0fe;
  --ink: #202124; --ink-2: #5f6368; --ink-3: #80868b; --ink-4: #9aa0a6;
  --bg: #f8f9fa; --dim: #f1f3f4;
  --line: #dadce0; --line-2: #e8eaed; --line-strong: #bdc1c6;
  --green: #1e8e3e; --green-50: #e6f4ea;
  --red: #c02f2f;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Golos Text", Arial, sans-serif;

  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

.epd-shell a { color: var(--blue); text-decoration: none; }
.epd-shell a:hover { color: var(--blue-700); }

@keyframes epd-screen-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.epd-screen {
  min-height: 100vh;
  padding: clamp(18px, 2.4vw, 32px) clamp(16px, 2.4vw, 40px);
  animation: epd-screen-in .34s var(--ease) both;
}

.epd-wrap { max-width: 820px; margin: 0 auto; }
.epd-wrap--wide { max-width: 900px; }

.epd-brand { display: inline-flex; align-items: center; margin-bottom: 18px; }
.epd-brand img { display: block; height: 44px; width: auto; }

/* Прогресс: шаг 1 — регистрация, шаг 2 — подключение Контур */
.epd-prog { display: flex; align-items: center; margin: 0 0 20px; }
.epd-pstep { display: flex; align-items: center; gap: 12px; }
.epd-pstep i {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 999px; border: 1px solid var(--line);
  background: #fff;
  font-size: 13px; font-weight: 700; font-style: normal; color: var(--ink-4);
  transition: background-color .34s var(--ease), border-color .34s var(--ease), color .34s var(--ease);
}
.epd-pstep span { font-size: 14px; font-weight: 500; color: var(--ink-4); transition: color .34s var(--ease); }
.epd-pstep.is-now i { background: var(--blue); border-color: var(--blue); color: #fff; }
.epd-pstep.is-now span { color: var(--ink); }
.epd-pstep.is-done i { background: var(--green-50); border-color: var(--green-50); color: var(--green); }
.epd-pstep.is-done span { color: var(--ink-2); }
.epd-pline {
  position: relative; flex: 1; min-width: 26px; height: 2px; margin: 0 16px;
  border-radius: 2px; background: var(--line-2); overflow: hidden;
}
.epd-pline::after {
  content: ""; position: absolute; inset: 0; background: var(--blue);
  transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease);
}
.epd-prog[data-step="2"] .epd-pline::after { transform: scaleX(1); }

.epd-h1 {
  margin: 0 0 10px;
  font-size: clamp(27px, 3.2vw, 36px); font-weight: 600;
  letter-spacing: -.03em; line-height: 1.08; text-wrap: balance;
}
.epd-lead { margin: 0 0 18px; font-size: 16px; line-height: 1.55; color: var(--ink-2); max-width: 64ch; }
.epd-accent {
  background: linear-gradient(100deg, var(--blue), #4285f4);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.epd-perks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; }
.epd-perk { padding: 12px 15px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.epd-perk b { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); }
.epd-perk span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--ink-2); }

.epd-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: clamp(20px, 2.4vw, 28px); }
.epd-card + .epd-card { margin-top: 14px; }

/* Форма */
.epd-field { margin-bottom: 14px; }
.epd-field:last-child { margin-bottom: 0; }
.epd-field > label,
.epd-legend { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--ink); }
.epd-legend { margin-bottom: 8px; }
.epd-hint { margin-top: 6px; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }

.epd-field input[type="text"],
.epd-field input[type="email"],
.epd-field input[type="tel"] {
  width: 100%; height: 46px; padding: 0 15px;
  font: 400 15.5px/1 var(--font); color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.epd-field input::placeholder { color: var(--ink-4); }
.epd-field input:hover { border-color: var(--line-strong); }
.epd-field input:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-50); }
.epd-field input:disabled { background: var(--dim); color: var(--ink-3); cursor: not-allowed; }
.epd-field input:disabled::placeholder { color: var(--line-strong); }

/* Поля заблокированы, пока ИНН не проверен (класс ставит form-validation.js) */
.epd-field.is-locked > label { color: var(--ink-3); }
.epd-field.is-locked .epd-hint { color: var(--ink-4); }

.epd-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.epd-role {
  position: relative; display: flex; align-items: center; gap: 11px;
  margin: 0; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  font-size: 15px; font-weight: 500; color: var(--ink);
  transition: border-color .18s var(--ease), background-color .18s var(--ease), box-shadow .18s var(--ease);
}
.epd-role:hover { border-color: var(--line-strong); background: var(--dim); }
.epd-role input { position: absolute; opacity: 0; pointer-events: none; }
.epd-role i {
  flex: 0 0 auto; width: 20px; height: 20px;
  border: 2px solid var(--line-strong); border-radius: 999px;
  transition: border-color .18s var(--ease), border-width .18s var(--ease);
}
.epd-role input:checked ~ i { border-color: var(--blue); border-width: 6px; }
.epd-role:has(input:checked) { border-color: var(--blue); background: var(--blue-50); }
.epd-role:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--blue-50); }

.epd-sec { margin-top: 6px; }

.epd-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  /* min-height, а не height: на узком экране подпись переносится на две
     строки и при фиксированной высоте вылезала за пределы кнопки. */
  width: 100%; min-height: 54px; padding: 10px 26px;
  border: 0; border-radius: 999px; cursor: pointer;
  text-align: center;
  font: 600 16.5px/1.25 var(--font); letter-spacing: -.01em;
  color: #fff; background: var(--blue);
  box-shadow: 0 10px 26px rgba(26, 115, 232, .26);
  transition: background-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}
.epd-btn:hover { background: var(--blue-700); box-shadow: 0 16px 38px rgba(26, 115, 232, .36); }
.epd-btn:active { transform: scale(.97); }
.epd-btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--blue-50); }
.epd-btn:disabled { background: var(--line); color: var(--ink-4); cursor: not-allowed; box-shadow: none; transform: none; }
.epd-btn:disabled:hover { background: var(--line); }

/* Спиннер отправки (класс is-loading ставит router.js) */
.epd-btn.is-loading::before {
  content: "";
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  border-radius: 50%;
  animation: epd-btn-spin .8s linear infinite;
}
.epd-btn.is-loading:disabled::before { border-color: rgba(154, 160, 166, .35); border-top-color: var(--ink-3); }
@keyframes epd-btn-spin { to { transform: rotate(360deg); } }

/* Кнопка-ссылка: цвет задаём явно, иначе её перебивает общее правило
   `.epd-shell a` (та же специфичность, но оно идёт выше) и текст становится
   синим на синем. */
a.epd-btn,
a.epd-btn:hover { color: #fff; text-decoration: none; }
a.epd-btn--ghost,
a.epd-btn--ghost:hover { color: var(--ink); }

.epd-btn--ghost {
  color: var(--ink); background: #fff;
  border: 1px solid var(--line-strong); box-shadow: none;
}
.epd-btn--ghost:hover { color: var(--ink); background: var(--dim); box-shadow: none; }
.epd-btn--sm { width: auto; min-height: 46px; font-size: 15px; box-shadow: none; }
.epd-btn--sm:hover { box-shadow: none; }

.epd-under { margin-top: 10px; text-align: center; font-size: 13px; line-height: 1.45; color: var(--ink-3); }

/* Карточка персональной ссылки на шаге 2 */
.epd-loading {
  display: flex; align-items: center; gap: 10px;
  margin: 0; font-size: 15px; color: var(--ink-2);
}
.epd-loading::before {
  content: ""; flex: 0 0 auto;
  width: 14px; height: 14px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%;
  animation: epd-spin .7s linear infinite;
}
@keyframes epd-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .epd-loading::before { animation-duration: 2.4s; }
}

.epd-error { margin: 0; font-size: 15px; line-height: 1.5; color: var(--red); }

.epd-notice {
  margin: 0 0 14px; padding: 12px 15px;
  background: var(--green-50); border-radius: 12px;
  font-size: 14px; line-height: 1.5; color: var(--ink-2);
}

.epd-linkrow { display: flex; gap: 10px; margin-top: 8px; }
.epd-linkrow input {
  flex: 1; min-width: 0;
  height: 46px; padding: 0 15px;
  font: 400 14px/1 var(--font); color: var(--ink-2);
  background: var(--dim); border: 1px solid var(--line-2); border-radius: 10px;
}
.epd-linkrow input:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-50); }

.epd-gap { margin-top: 14px; }

.epd-shell .epd-back {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 20px;
  font-size: 15px; font-weight: 500; color: var(--blue);
}
.epd-shell .epd-back:hover { color: var(--blue-700); }

@media (max-width: 520px) {
  .epd-linkrow { flex-direction: column; }
  .epd-btn--sm { width: 100%; }
}

.epd-or { display: flex; align-items: center; gap: 14px; margin: 14px 0; color: var(--ink-4); font-size: 14px; }
.epd-or::before, .epd-or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.epd-center { text-align: center; font-size: 16px; font-weight: 500; }

.epd-consent {
  position: relative;
  display: flex; align-items: flex-start; gap: 11px;
  margin: 14px 0 0; cursor: pointer;
  font-size: 12.5px; line-height: 1.5; color: var(--ink-2);
}
.epd-consent input { position: absolute; opacity: 0; pointer-events: none; }
.epd-consent i {
  flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px;
  border: 2px solid var(--line-strong); border-radius: 5px; background: #fff;
  transition: background-color .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.epd-consent input:checked ~ i {
  background: var(--blue) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6L9 17l-5-5'/></svg>") center/13px 13px no-repeat;
  border-color: var(--blue);
}
.epd-consent input:focus-visible ~ i { box-shadow: 0 0 0 3px var(--blue-50); }
.epd-consent input:disabled ~ i { background-color: var(--dim); border-color: var(--line); }
.epd-consent:has(input:disabled) { cursor: not-allowed; color: var(--ink-3); }
.epd-consent a { font-weight: 500; }

/* Сообщения общей логики форм (router.js / form-validation.js) в этой раскладке */
.epd-shell .inn-status,
.epd-shell .inn-webhook-message { margin: -8px 0 14px; font-size: 13px; line-height: 1.4; }
.epd-shell .inn-status[data-type="error"],
.epd-shell .inn-webhook-message[data-type="error"] { color: var(--red); }
.epd-shell .inn-status[data-type="loading"] { color: var(--ink-2); }
.epd-shell .form-error { margin-top: 12px; text-align: center; color: var(--red); font-size: 14px; line-height: 1.4; }

/* Экран после регистрации */
.epd-tick {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin-bottom: 22px;
  border-radius: 999px; background: var(--green-50);
}
.epd-tick svg { width: 28px; height: 28px; color: var(--green); }
.epd-eyebrow { margin: 0 0 10px; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.epd-h2 { margin: 0 0 12px; font-size: clamp(21px, 2.2vw, 25px); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.epd-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.epd-steps li { position: relative; counter-increment: s; padding: 0 0 16px 44px; font-size: 15px; line-height: 1.6; }
.epd-steps li:last-child { padding-bottom: 0; }
.epd-steps li::before {
  content: counter(s);
  position: absolute; left: 0; top: -1px;
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 999px;
  background: var(--blue-50); color: var(--blue);
  font-size: 13px; font-weight: 700;
}
.epd-note { margin: 20px 0 0; padding: 16px 18px; background: var(--dim); border-radius: 12px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }

@media (max-width: 720px) {
  .epd-perks { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .epd-pstep span { display: none; }
  .epd-pline { margin: 0 10px; }
}

@media (max-width: 520px) {
  .epd-roles { grid-template-columns: 1fr; }
}
