/* ==========================================================================
   Модалка регистрации на курс (марафон, мини-курсы) — js/course-signup.js.
   Классы с префиксом cs-, чтобы не пересекаться со стилями страниц.
   Цвета и шрифты — из base.css; запасные значения на случай страницы без него.
   ========================================================================== */

.cs-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(42, 33, 28, 0.55);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.cs-backdrop.is-open {
  opacity: 1;
}

.cs-dialog {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 92vh;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 28px 20px calc(24px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--color-mist, #FAF6F0);
  color: var(--color-ember, #2A211C);
  font-family: var(--font-body, 'Golos Text', system-ui, sans-serif);
  transform: translateY(24px);
  transition: transform 0.25s ease;
}

.cs-backdrop.is-open .cs-dialog {
  transform: none;
}

@media (min-width: 600px) {
  .cs-backdrop {
    align-items: center;
  }

  .cs-dialog {
    padding: 36px 32px 32px;
    border-radius: 24px;
  }
}

.cs-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--color-ember-60, rgba(42, 33, 28, 0.6));
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.cs-close:hover {
  background: var(--color-ember-12, rgba(42, 33, 28, 0.12));
}

.cs-eyebrow {
  margin: 0 0 8px;
  color: var(--color-terracotta-rose, #D96A4F);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cs-title {
  margin: 0 0 8px;
  font-family: var(--font-display, 'Evolventa', system-ui, sans-serif);
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.15;
}

.cs-lead {
  margin: 0 0 22px;
  color: var(--color-ember-60, rgba(42, 33, 28, 0.6));
  font-size: 0.9375rem;
  line-height: 1.5;
}

.cs-field {
  display: block;
  margin-bottom: 14px;
}

.cs-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 500;
}

.cs-input,
.cs-country {
  box-sizing: border-box;
  height: 52px;
  border: 1px solid var(--color-ember-12, rgba(42, 33, 28, 0.12));
  border-radius: 14px;
  background: #fff;
  color: inherit;
  font: inherit;
  /* 16px и больше — иначе iOS увеличивает страницу при фокусе. */
  font-size: 1.0625rem;
}

.cs-input {
  width: 100%;
  padding: 0 16px;
}

.cs-input:focus,
.cs-country:focus {
  outline: none;
  border-color: var(--color-marigold, #E77611);
  box-shadow: 0 0 0 3px rgba(231, 118, 17, 0.15);
}

.cs-phone {
  display: flex;
  gap: 8px;
}

.cs-country {
  flex: 0 0 auto;
  width: 112px;
  padding: 0 8px;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.cs-phone-check {
  min-height: 1.2em;
  margin: 8px 0 0;
  color: var(--color-ember-60, rgba(42, 33, 28, 0.6));
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.cs-error {
  min-height: 1.2em;
  margin: 4px 0 10px;
  color: #B3261E;
  font-size: 0.875rem;
}

.cs-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--gradient-dawn, linear-gradient(89deg, #E77611 0%, #FFB675 100%));
  color: #fff;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.2s ease;
}

.cs-button:active {
  transform: scale(0.98);
}

.cs-button[disabled] {
  opacity: 0.6;
  cursor: default;
}

.cs-button--telegram {
  background: #229ED9;
}

.cs-consent {
  margin: 12px 0 0;
  color: var(--color-ember-60, rgba(42, 33, 28, 0.6));
  font-size: 0.8125rem;
  line-height: 1.45;
  text-align: center;
}

.cs-consent a {
  color: inherit;
}

.cs-steps {
  display: flex;
  gap: 6px;
  margin: 0 40px 18px 0; /* справа — место под крестик */
}

.cs-steps span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--color-ember-12, rgba(42, 33, 28, 0.12));
}

.cs-steps span.is-done {
  background: var(--color-marigold, #E77611);
}

.cs-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--color-sand, #F5EDE2);
  color: var(--color-marigold, #E77611);
  font-size: 24px;
}

.cs-hint {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--color-sand, #F5EDE2);
  font-size: 0.875rem;
  line-height: 1.5;
}

.cs-hint p {
  margin: 0 0 6px;
}

.cs-hint p:last-child {
  margin-bottom: 0;
}

.cs-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-terracotta-rose, #D96A4F);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.cs-done {
  color: #2E7D32;
  font-weight: 600;
}

body.cs-locked {
  overflow: hidden;
}
