:root {
  --bg-overlay: rgba(0, 0, 0, 0.45);
  --card-bg: rgba(255, 255, 255, 0.78);
  --form-bg: rgba(255, 255, 255, 0.78);
  --text: #1a1a1a;
  --text-muted: #444;
  --primary: #e85c1a;
  --primary-hover: #c94f14;
  --border: #ccc;
  --error: #b00;
  --radius: 0;
  --min-touch: 44px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-width: 320px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: #1a1a1a;
}

/* Фон: плавная загрузка — сначала тёмный, после загрузки картинки плавно появляется */
.bg {
  position: fixed;
  inset: 0;
  background-color: #1a1a1a;
  background-image: url("assets/bg.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: -2;
  opacity: 0;
  transition: opacity 0.6s ease-out;
}

body.bg-loaded .bg {
  opacity: 1;
}

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg-overlay);
  z-index: -1;
}

.container {
  position: relative;
  min-height: 100vh;
  padding: clamp(1rem, 4vw, 2rem);
}

/* Герой: текст и кнопка в нижней части экрана, кнопка выше */
.screen.hero-screen {
  position: fixed;
  bottom: clamp(10vh, 14vw, 24vh);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  min-width: 300px;
  padding: 0 clamp(1rem, 4vw, 2rem);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  text-align: center;
  z-index: 1;
}

.screen.hero-screen.hidden {
  display: none !important;
}

.screen.hero-screen:not(.hidden) {
  display: block;
}

.hero-title {
  margin: 0 0 1.5rem;
  font-size: clamp(2.25rem, 7vw, 3.5rem);
  font-weight: 900;
  line-height: 1.15;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.screen.hero-screen .tagline {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.25rem;
}

.screen.hero-screen .btn {
  min-width: 300px;
  width: 100%;
}

.screen:not(.hero-screen) {
  width: 100%;
  max-width: 420px;
  padding: clamp(1.5rem, 5vw, 2.5rem);
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.screen.hidden {
  display: none !important;
}

.screen:not(.hero-screen):not(.hidden) {
  display: block;
}

.screen:not(.hero-screen) h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  line-height: 1.25;
}

.tagline {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.4;
}

/* Все кнопки: оранжевые, без скруглений, белый текст, заглавные */
.btn {
  display: inline-block;
  min-height: var(--min-touch);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.2s;
  background: var(--primary);
  color: #fff;
}

.btn:hover,
.btn:focus {
  background: var(--primary-hover);
}

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

/* Форма: по центру экрана при открытии, крестик сверху справа */
.form-section {
  width: 100%;
  max-width: 420px;
  position: relative;
  padding-top: 2.5rem;
  z-index: 2;
}

.form-section.hidden {
  display: none !important;
}

.form-section:not(.hidden) {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

.form-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  font-size: 1.75rem;
  line-height: 1;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.form-close:hover,
.form-close:focus {
  color: var(--primary);
}

.form {
  padding: clamp(1.5rem, 5vw, 2.5rem);
  background: var(--form-bg);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  text-align: left;
}

.form h2 {
  margin: 0 0 1.25rem;
  font-size: 1.25rem;
  text-align: center;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input,
.form-group select {
  width: 100%;
  min-height: var(--min-touch);
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}

.form-group input:focus,
.form-group select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.field-error {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--error);
}

.form-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
}

.form-actions .btn {
  width: 100%;
  max-width: 280px;
}

.form-error {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--error);
  text-align: center;
}

@media (max-width: 768px) {
  .container {
    padding-bottom: clamp(6vh, 12vw, 20vh);
  }
}
