/* ────────────────────────────────────────────────────────────────────────────
   Основные стили — адаптивная форма отчётности
   Без сторонних CSS-фреймворков.
   ──────────────────────────────────────────────────────────────────────────── */

/* Сброс и базовые стили */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  background: #f5f6fa;
  color: #2d3748;
  line-height: 1.6;
  min-height: 100vh;
  padding: 16px;
}

/* Контейнер */
.container {
  max-width: 720px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  padding: 32px 28px;
}

.container--narrow {
  max-width: 480px;
}

/* Заголовок страницы */
.page-header {
  margin-bottom: 28px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 20px;
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a202c;
}

.subtitle {
  font-size: 0.9rem;
  color: #718096;
  margin-top: 6px;
}

/* ── Alert ─────────────────────────────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 22px;
  font-size: 0.95rem;
}

.alert-error {
  background: #fff5f5;
  border: 1px solid #fc8181;
  color: #c53030;
}

/* ── Группа поля ───────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 6px;
}

/* Обязательные поля — красная звёздочка */
.form-group label.required::after {
  content: " *";
  color: #e53e3e;
}

/* ── Поля ввода ────────────────────────────────────────────────────────────── */
input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 1rem;
  font-family: inherit;
  border: 1.5px solid #cbd5e0;
  border-radius: 8px;
  background: #f7fafc;
  color: #2d3748;
  transition: border-color 0.2s, box-shadow 0.2s;
  /* Минимальный размер зоны нажатия 44px */
  min-height: 44px;
  appearance: none;
  -webkit-appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23718096' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

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

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
  background: #fff;
}

/* Файловый инпут */
input[type="file"] {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  border: 1.5px dashed #a0aec0;
  background: #f7fafc;
  min-height: 44px;
}

input[type="file"]:focus {
  outline: 2px solid #4299e1;
  outline-offset: 2px;
}

/* ── Состояние ошибки ──────────────────────────────────────────────────────── */
.has-error input,
.has-error select,
.has-error textarea {
  border-color: #fc8181;
  background: #fff5f5;
}

.field-error {
  display: block;
  font-size: 0.82rem;
  color: #c53030;
  margin-top: 4px;
}

.field-hint {
  display: block;
  font-size: 0.8rem;
  color: #a0aec0;
  margin-top: 4px;
}

/* ── Captcha ───────────────────────────────────────────────────────────────── */
.captcha-group {
  margin-top: 8px;
}

/* ── Кнопка отправки ───────────────────────────────────────────────────────── */
.form-actions {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 2px solid #e2e8f0;
}

.btn-submit {
  display: block;
  width: 100%;
  padding: 14px 20px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: #3182ce;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.01em;
}

.btn-submit:hover {
  background: #2b6cb0;
}

.btn-submit:active {
  transform: scale(0.98);
}

.btn-submit:disabled {
  background: #a0aec0;
  cursor: not-allowed;
}

/* ── Страница успеха ───────────────────────────────────────────────────────── */
.success-card {
  text-align: center;
  padding: 40px 20px;
}

.success-icon {
  font-size: 4rem;
  color: #38a169;
  line-height: 1;
  margin-bottom: 16px;
  display: inline-block;
  background: #f0fff4;
  border-radius: 50%;
  width: 96px;
  height: 96px;
  line-height: 96px;
}

.success-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 12px;
}

.success-message {
  font-size: 1rem;
  color: #4a5568;
  max-width: 420px;
  margin: 0 auto 28px;
  line-height: 1.7;
}

.btn-back {
  display: inline-block;
  padding: 12px 28px;
  background: #3182ce;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 44px;
  line-height: 20px;
  transition: background 0.2s;
}

.btn-back:hover {
  background: #2b6cb0;
}

/* ── Honeypot — скрыт для людей ────────────────────────────────────────────── */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  tab-size: 0;
}

/* ── Адаптивность ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  body {
    padding: 8px;
  }

  .container {
    padding: 20px 16px;
    border-radius: 8px;
  }

  .page-header h1 {
    font-size: 1.3rem;
  }

  .btn-submit {
    font-size: 1rem;
    padding: 13px 16px;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .container {
    padding: 28px 24px;
  }
}
