/* ========================================
   ГОСУСЛУГИ 2025 — ПОЛНЫЙ РАБОЧИЙ style.css
   ======================================== */

/* 1. CSS RESET */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section { display: block; }
ol, ul { list-style: none; }

/* 2. ШРИФТ */
@import url('https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700&display=swap');

/* 3. ПЕРЕМЕННЫЕ */
:root {
  --color-gosblue: #0d4cd3;
}

/* 4. БАЗОВЫЕ СТИЛИ */
*, *::before, *::after { box-sizing: border-box; }
body, html {
  height: 100%;
  font-family: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #0b1f33;
  background: #e4ecfd;
}
body {
  padding: 64px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 5. КОНТЕЙНЕР */
.container {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 100px 32px;
  position: relative;
}

/* Логотип */
.logo {
  display: block;
  margin: 0 auto;
  max-width: 250px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* 6. ПОЛЯ ВВОДА */
.input-label-static {
  display: block;
  font-size: 14px;
  color: #0b1f33;
  margin-bottom: 8px;
  font-weight: 500;
}
.plain-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04) !important;
  transition: all 0.2s;
  outline: none;
}
.plain-input:focus {
  background: rgba(0, 0, 0, 0.06) !important;
  border-color: #004B98 !important;
  box-shadow: 0 0 0 3px rgba(0, 75, 152, 0.15);
}
.plain-input.error {
  background: rgba(238, 63, 88, 0.16) !important;
  border-color: #d32f2f !important;
}

/* 7. ПАРОЛЬ + ГЛАЗИК */
.input-password {
  position: relative;
}
#togglePassword {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
#togglePassword svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  fill: none;
  stroke: currentColor;
  color: #6b7280;
}
#togglePassword:hover svg { color: #004B98; }

/* 8. ОШИБКИ */
.error-text {
  color: #d32f2f !important;
  font-size: 14px !important;
  margin-top: 8px !important;
  padding-left: 4px !important;
  text-align: left !important;
  display: block !important;
  min-height: 22px !important;
}

/* 9. КНОПКИ */
.plain-button {
  display: inline-block;
  border-radius: 8px;
  border: none;
  padding: 14px 16px;
  font-size: 16px;
  line-height: 24px;
  color: #fff;
  background: var(--color-gosblue);
  cursor: pointer;
  width: 100%;
  text-align: center;
  font-weight: 700;
  transition: background 0.2s;
}
.plain-button:hover { background: #0a3eb5; }
.plain-button_light {
  background: #f5f8ff;
  color: #004b98;
  border: 1px solid #d0d5dd;
  width: 100%;
  padding: 12px;
  font-size: 14px;
  border-radius: 8px;
  font-weight: 500;
}
.plain-button_light:hover { background: #e6eeff; }

/* 10. ОТСТУПЫ */
.mb-20 { margin-bottom: 20px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mt-40 { margin-top: 40px; }

/* 11. РАЗДЕЛИТЕЛЬ */
.divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 32px 0;
  width: 100%;
}

/* 12. "Войти другим способом" */
.form-container__actions { margin-top: 30px; }
.form-container__actions-title {
  font-size: 12px;
  color: #0b1f33;
  margin-bottom: 16px;
  text-align: center;
  line-height: 24px;
  height: 24px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}
.form-container__actions-title a {
  color: var(--color-gosblue);
  text-decoration: none;
  font-weight: 500;
}
.form-container__actions-title a:hover { text-decoration: underline; }
.form-container__actions-row_grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* 13. ЛОАДЕР */
#loadingOverlay {
  position: absolute;      /* было fixed */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.7); /* светлый полупрозрачный фон */
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10;             /* достаточно перекрыть форму */
  flex-direction: column;
}

}
.loader {
  width: 50px; height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0d4cd3;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 14. 6-ЗНАЧНЫЙ КОД */
.code-title {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  margin: 20px 0 30px 0;
}
.code-label {
  text-align: left;
  margin: 0 0 6px 10px;
  font-size: 15px;
  font-weight: 400;
  color: #333;
}
.code-inputs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0;
}
.code-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 28px !important;
  font-weight: 500 !important;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  outline: none;
}
.code-input:focus {
  border-color: #0d4cd3;
  box-shadow: 0 0 0 3px rgba(13, 76, 211, 0.1);
}
.timer-text, #resendCode { display: none !important; }

/* 15. ШАГИ */
.step { display: none; }
.step.active { display: block; }

/* 16. ДОП. СТИЛИ */
@keyframes shake {
  0%,100%{transform:translateX(0)}
  10%,30%,50%,70%,90%{transform:translateX(-5px)}
  20%,40%,60%,80%{transform:translateX(5px)}
}
.shake { animation: shake .5s; }
.hero-slide img {
  width:100%; height:100%; object-fit:cover; object-position:center;
  filter:brightness(0.68); image-rendering:crisp-edges;
}

/* =========================
   АДАПТАЦИЯ / РЕСПОНСИВ
   ========================= */

/* 💻 Большие экраны — визуально как 90% зум */
@media (min-width: 1200px) {
  .container {
    transform: scale(0.9);
    transform-origin: center center;
  }
}

/* Планшеты и небольшие ноуты */
@media (max-width: 1024px) {
  body {
    padding: 40px 16px;
  }
  .container {
    padding: 70px 28px;
    transform: none; /* без масштабирования */
  }
}

/* Телефоны (портрет, до ~768px) */
@media (max-width: 768px) {
  body {
    padding: 24px 12px;
    align-items: flex-start;
    min-height: 100vh;
  }

  .container {
    width: 90%;
    max-width: 480px;
    margin: 32px auto;
    padding: 40px 20px;
    border-radius: 16px;
    transform: none; /* никакого scale на мобилках */
  }

  header.mb-40 {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    text-align: center;
  }

  .logo {
    max-width: 230px;
  }
}

/* Маленькие телефоны (до 480px) */
@media (max-width: 480px) {
  body {
    padding: 16px 10px;
  }

  .container {
    padding: 28px 16px 24px;
    border-radius: 12px;
    max-height: 100vh;
    overflow-y: auto;
  }

  header.mb-40 {
    margin-top: 4px !important;
    margin-bottom: 18px !important;
  }

  .logo {
    max-width: 210px;
  }

  .plain-input {
    padding: 12px 14px;
    font-size: 15px;
  }

  .plain-button {
    padding: 12px;
    font-size: 15px;
  }

  .form-container__actions-title {
    font-size: 11px;
  }

  .code-inputs {
    gap: 8px !important;
  }

  .code-input {
    width: 38px !important;
    height: 46px !important;
    font-size: 20px !important;
    border-radius: 8px;
  }

  .code-title {
    font-size: 19px;
  }

  .code-subtitle {
    font-size: 13px;
  }
}
