:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #101828;
  --muted: #667085;
  --border: #e4e7ec;
  --shadow: 0 20px 45px rgba(16, 24, 40, 0.08);
  --accent: #2b6cff;
  --accent-hover: #1f57d7;
  --danger: #b42318;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans",
    sans-serif;
  color: var(--text);
  background: radial-gradient(800px 400px at 50% 0%, #eef3ff 0%, var(--bg) 60%, var(--bg) 100%);
}

.page {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.card {
  width: 100%;
  max-width: 720px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card__inner {
  padding: 26px 22px;
}

.title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
}

.subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.steps {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.kv {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 160px 1fr;
  row-gap: 8px;
  column-gap: 12px;
  font-size: 14px;
}

.kv__k {
  color: var(--muted);
}

.kv__v {
  font-weight: 600;
  word-break: break-word;
}

.form {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  font-size: 15px;
  background: #fff;
}

.phoneRow {
  display: flex;
  gap: 10px;
}

.country {
  min-width: 210px;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  font-size: 14px;
  color: var(--text);
  background: #fff;
}

.phoneInput {
  flex: 1;
}

.country:focus {
  border-color: rgba(43, 108, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(43, 108, 255, 0.12);
}

.field input:focus {
  border-color: rgba(43, 108, 255, 0.5);
  box-shadow: 0 0 0 4px rgba(43, 108, 255, 0.12);
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn:not(:disabled):hover {
  background: var(--accent-hover);
}

.status {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--danger);
  white-space: pre-wrap;
}

.note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.link:hover {
  text-decoration: underline;
}

.footer {
  background: #fbfcfe;
  border-top: 1px solid var(--border);
  padding: 18px 22px;
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.footer strong {
  color: var(--text);
  font-weight: 700;
}

.doc {
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
}

.doc h2 {
  margin: 18px 0 8px;
  font-size: 16px;
  line-height: 1.3;
}

.doc p {
  margin: 8px 0;
}

.doc ol {
  margin: 8px 0;
  padding-left: 18px;
}

.modalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px 16px;
  z-index: 50;
}

.modalOverlay[data-open="1"] {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 760px;
  max-height: min(78vh, 720px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.modalHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px;
  border-bottom: 1px solid var(--border);
  background: #fbfcfe;
}

.modalTitle {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 800;
}

.modalClose {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
}

.modalClose:hover {
  background: #f5f7ff;
}

.modalBody {
  padding: 16px 16px;
  overflow: auto;
}

@media (max-width: 520px) {
  .kv {
    grid-template-columns: 1fr;
  }
  .kv__k {
    font-size: 12px;
  }
  .kv__v {
    margin-top: -4px;
  }
  .phoneRow {
    flex-direction: column;
  }
  .country {
    min-width: 0;
    width: 100%;
  }
  .modal {
    max-height: 84vh;
  }
}
