/* gosi — стили (палитра и отступы как на esia.gosuslugi.ru) */
:root {
  --gosblue: #0d4cd3;
  --gosblue-hover: #1d5deb;
  --gosblue-active: #0b40b3;
  --red: #ee3f58;
  --text: #0b1f33;
  --helper: #66727f;
  --bg: #e4ecfd;
  --input: #f5f7fa;
  --border: #e1e1e1;
  --shadow: rgba(230, 235, 245, 0.4);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Lato, 'Segoe UI', Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
}

a, button { font: inherit; cursor: pointer; }

/* ------- раскладка ------- */
.wrap {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: flex-start;
  padding: 48px 16px;
  min-height: 100vh;
}
.wrap--single { align-items: center; }

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 48px var(--shadow);
}
.card--form {
  width: 416px;
  max-width: 100%;
  padding: 40px 32px;
}
.card--banner {
  width: 280px;
  max-width: 100%;
  padding: 24px;
}

@media (max-width: 767px) {
  .wrap { flex-direction: column; align-items: center; }
  .card--banner { width: 416px; }
}

/* ------- логотип ------- */
.logo {
  text-align: center;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  user-select: none;
}
.logo__blue { color: var(--gosblue); }
.logo__red { color: var(--red); }

.lang {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px auto 28px;
  padding: 0;
  background: none;
  border: none;
  font-size: 14px;
  line-height: 1;
  color: var(--gosblue);
}
.lang:hover { color: var(--gosblue-hover); }

/* ------- поля ------- */
.field { margin-bottom: 16px; }
.field__label {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
}
.field__input {
  width: 100%;
  background: var(--input);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 16px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.field__input:focus { border-color: var(--gosblue); background: #fff; }
.field__input::placeholder { color: var(--helper); }

/* ------- ссылки ------- */
.link { color: var(--gosblue); text-decoration: none; }
.link:hover { color: var(--gosblue-hover); text-decoration: underline; }
.link--left { display: inline-block; font-size: 14px; margin-bottom: 24px; }
.link--center { display: block; text-align: center; font-size: 14px; margin-top: 24px; }

/* ------- кнопки ------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 16px;
  line-height: 24px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn--primary {
  width: 100%;
  padding: 14px 16px;
  background: var(--gosblue);
  color: #fff;
  border: none;
}
.btn--primary:hover { background: var(--gosblue-hover); }
.btn--primary:active { background: var(--gosblue-active); }
.btn--primary:disabled { background: #e5eaf5; color: var(--helper); cursor: default; }
.btn--primary.is-loading { position: relative; color: transparent; pointer-events: none; }
.btn--primary.is-loading::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 22px; height: 22px;
  margin: -11px 0 0 -11px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn--outline {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--gosblue);
  color: var(--gosblue);
  background: #fff;
  margin-top: 12px;
}
.btn--outline:hover { background: var(--input); }

.divider { border: none; height: 1px; background: var(--border); margin: 24px 0; }

.alt__hint { font-size: 14px; margin: 0 0 12px; }

/* ------- карточка услуги ------- */
.banner__medal { width: 110px; display: block; margin: 0 auto 16px; }
.banner__title { font-size: 16px; line-height: 24px; font-weight: 700; margin: 0 0 8px; }
.banner__sub { font-size: 14px; line-height: 20px; margin: 0 0 16px; }
.banner__row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 20px;
  margin-bottom: 14px;
}
.banner__row svg { flex: none; margin-top: 2px; }
.banner__row p { margin: 0; }

/* ------- страница кода ------- */
.code__title { font-size: 24px; line-height: 32px; font-weight: 700; margin: 16px 0 8px; }
.code__sub { font-size: 14px; color: var(--helper); margin: 0 0 24px; }

.code__boxes { display: flex; gap: 8px; justify-content: center; }
.code__boxes input {
  width: 44px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  background: var(--input);
  border: 1px solid transparent;
  border-radius: 8px;
  outline: none;
  color: var(--text);
}
.code__boxes input:focus { border-color: var(--gosblue); background: #fff; }

.code__timer { text-align: center; font-size: 13px; color: var(--helper); margin: 12px 0 20px; }

/* ------- оверлеи ------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(228, 236, 253, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.overlay[hidden] { display: none; }
.overlay__card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 48px var(--shadow);
  padding: 40px 48px;
  text-align: center;
  max-width: 360px;
}
.overlay__card h2 { font-size: 20px; margin: 12px 0 8px; }
.overlay__card p { font-size: 14px; color: var(--helper); margin: 0; }

.spinner {
  width: 44px; height: 44px;
  border: 4px solid #e5eaf5;
  border-top-color: var(--gosblue);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------- тряска при пустом отправлении ------- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
.shake { animation: shake 0.3s ease 2; }
