* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1f2330;
  background: linear-gradient(110deg, #5b50d6 0%, #4f64cf 28%, #3f87c6 55%, #2bac9c 80%, #22b894 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  gap: 28px;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand__logo {
  width: 76px;
  height: 76px;
  display: block;
  filter: drop-shadow(0 8px 18px rgba(20, 40, 60, 0.25));
}

/* Card */
.card {
  width: 100%;
  max-width: 620px;
  background: #fff;
  border-radius: 24px;
  padding: 36px 44px 32px;
  box-shadow: 0 30px 60px rgba(40, 50, 110, 0.20);
}

.card__head { text-align: center; margin-bottom: 26px; }
.card__head h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #111827;
}
.card__subtitle {
  margin: 8px 0 0;
  font-size: 14px;
  color: #9aa1ad;
}

.channel-line { margin: 0 0 22px; font-size: 13px; text-align: center; }
.muted { color: #9aa1ad; }

/* Stepper */
.stepper {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  padding: 4px 4px 0;
  margin-bottom: 22px;
}

.stepper-line {
  position: absolute;
  top: 14px;
  left: calc(16.666% + 14px);
  right: calc(16.666% + 14px);
  height: 2px;
  pointer-events: none;
}
.stepper-track {
  position: absolute;
  inset: 0;
  background: #e5e7eb;
  border-radius: 2px;
}
.stepper-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #6366f1;
  border-radius: 2px;
  transition: width .25s ease;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.step__circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #9ca3af;
  transition: background .2s, border-color .2s, color .2s;
}

.step__num { line-height: 1; }

.step__label {
  font-size: 12px;
  color: #9aa1ad;
  text-align: center;
  line-height: 1.2;
}

.step[data-state="active"] .step__circle {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}
.step[data-state="active"] .step__label {
  color: #1f2330;
  font-weight: 600;
}

.step[data-state="done"] .step__circle {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}
.step[data-state="done"] .step__num { display: none; }
.step[data-state="done"] .step__circle::after {
  content: "";
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}
.step[data-state="done"] .step__label {
  color: #1f2330;
}

/* Form */
form { display: flex; flex-direction: column; gap: 22px; }

.field-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-group__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}

.field-group__title--section {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

.legend--bold {
  font-weight: 700;
  color: #374151;
}

label { display: flex; flex-direction: column; gap: 7px; font-size: 14px; font-weight: 600; color: #374151; }

input, select, textarea {
  font-family: inherit;
  font-weight: 400;
  font-size: 15px;
  padding: 13px 16px;
  border: 1px solid #e3e6ee;
  border-radius: 12px;
  background: #fff;
  width: 100%;
  max-width: 100%;
  color: #1f2330;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #b6bcc8; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

textarea { resize: vertical; min-height: 96px; }

.channel-fallback {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.channel-fallback[hidden] { display: none; }
.channel-fallback legend {
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 2px;
}

/* Messenger cards */
.messenger-cards {
  display: flex;
  gap: 12px;
}

.messenger-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  border: 2px solid #e3e6ee;
  border-radius: 14px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  background: #fff;
  user-select: none;
}

.messenger-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.messenger-card img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 10px;
}

.messenger-card:hover {
  border-color: #c7caff;
  background: #f8f8ff;
}

.messenger-card:has(input:checked) {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
  background: #f5f5ff;
  color: #4f46e5;
}

.status { min-height: 1.2em; margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.status.error { color: #dc2626; }
.status.ok { color: #059669; }

/* Button */
button {
  font: inherit;
  padding: 15px 16px;
  background: #6366f1;
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  width: 100%;
  transition: background .15s, transform .05s;
}
button:hover { background: #5457e5; }
button:active { transform: translateY(1px); }
button:disabled { background: #c7cad6; cursor: not-allowed; }

body, .card { overflow-wrap: anywhere; }

@media (max-width: 480px) {
  .page { padding: 24px 14px; gap: 22px; }
  .card { padding: 28px 22px 26px; border-radius: 20px; }
  .card__head h1 { font-size: 21px; }
  .brand__logo { width: 64px; height: 64px; }
}

@media (max-width: 360px) {
  .step__label { font-size: 11px; }
  .step__circle { width: 26px; height: 26px; font-size: 12px; }
  input, select, textarea { padding: 11px 13px; }
}
