/* КОМИТ by ((SETTERS)NoNameBuro) — мини-апп регистрации
   палитра/мотив из брендбука: кремовый, васильковый, оливково-лайм, мотив «магнитного поля» (эллипсы) */

/* Factor A — лицензионный шрифт, файлы кладутся в /public/fonts (см. fonts/README.txt).
   Пока их нет — браузер падает на Onest (близкий бесплатный гротеск). */
@font-face { font-family: 'Factor A'; src: url('/fonts/FactorA-Light.woff2') format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Factor A'; src: url('/fonts/FactorA-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Factor A'; src: url('/fonts/FactorA-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Factor A'; src: url('/fonts/FactorA-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --cream: #fbf7e9;
  --cream-card: #fffdf3;
  --ink: #1b1b18;
  --ink-soft: #6f6d61;
  --peri: #8195ce;
  --peri-deep: #6577ba;
  --lime: #c5c83e;
  --lime-bright: #d4d65a;
  --line: #e9e2cf;
  --line: #e8e3cf;
  --radius: 18px;
  --font-display: 'Factor A', 'Onest', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-text: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; max-width: 100%; }
body {
  font-family: var(--font-text);
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===================== ЭКРАН ЗАГРУЗКИ ===================== */
#loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--peri);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loader.hide { opacity: 0; visibility: hidden; }

.field { width: min(72vw, 320px); aspect-ratio: 1 / 1; position: relative; animation: pulse 3.4s ease-in-out infinite; }
.field svg { width: 100%; height: 100%; display: block; }
.field .ln {
  fill: none;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 1.4;
  opacity: 0.2;
  transform-box: fill-box;
  transform-origin: center;
  animation: breathe 2.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.16s);
}
@keyframes breathe { 0%, 100% { opacity: 0.15; } 50% { opacity: 0.92; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }

.loader-word {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(38px, 13vw, 64px);
  letter-spacing: 1px;
  color: #fff;
  line-height: 1;
  animation: fadeup 0.9s ease both;
}
.loader-word .p { opacity: 0.55; }
.loader-by { font-size: 13px; color: rgba(255, 255, 255, 0.78); letter-spacing: 0.3px; animation: fadeup 0.9s 0.15s ease both; }
@keyframes fadeup { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .field, .field .ln, .loader-word, .loader-by { animation: none !important; }
  .field .ln { opacity: 0.6; }
}

/* ===================== ФОРМА ===================== */
.wrap { width: 100%; max-width: 470px; margin: 0 auto; padding: 18px 18px 44px; position: relative; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.2px;
  color: var(--ink-soft);
  margin-bottom: 28px;
  white-space: nowrap;
}
.topbar .pp { color: var(--peri); }

.hero { text-align: center; margin-bottom: 8px; }
.wordmark {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(38px, 12vw, 66px);
  line-height: 0.92;
  letter-spacing: 0;
  margin: 0;
  color: var(--ink);
  white-space: nowrap;
  max-width: 100%;
}
.wordmark .p { color: var(--lime); font-weight: 400; }
.tagline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.25;
  margin: 14px auto 0;
  max-width: 300px;
  color: var(--ink);
}
.subtag { font-size: 14px; color: var(--ink-soft); margin: 10px auto 0; max-width: 320px; }

/* карточка-форма (как бейдж/билет) */
.card {
  position: relative;
  background: var(--cream-card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-top: 26px;
}
/* перфорация-«билет» сверху */
.card::before {
  content: '';
  position: absolute;
  top: -1.5px; left: 18px; right: 18px;
  height: 0; border-top: 2px dashed var(--line);
}

.fld { margin-bottom: 16px; }
.fld label {
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink);
  margin-bottom: 7px;
}
.fld input[type='text'] {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  font-family: var(--font-text);
  color: var(--ink);
  border: none;
  border-bottom: 1.6px solid var(--line);
  border-radius: 0;
  background: transparent;
  transition: border-color 0.15s;
}
.fld input::placeholder { color: #b9b6a6; }
.fld input[type='text']:focus { outline: none; border-bottom-color: var(--peri); }

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
  margin-top: 4px;
}
.check input { margin-top: 1px; width: 19px; height: 19px; accent-color: var(--peri); flex: 0 0 auto; }

.btn {
  width: 100%;
  margin-top: 18px;
  padding: 17px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink);
  background: var(--lime);
  border: none;
  border-radius: 13px;
  cursor: pointer;
  transition: transform 0.05s, background 0.15s;
}
.btn:hover { background: var(--lime-bright); }
.btn:active { transform: scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: default; }

.note { margin-top: 14px; font-size: 13px; text-align: center; color: var(--ink-soft); }
.error { color: #b23b3b; }

/* успех */
.success { text-align: center; padding: 18px 12px 8px; }
.success .field-mini { width: min(56vw, 220px); margin: 0 auto 10px; }
.success .field-mini .ln { fill: none; stroke: var(--peri); stroke-width: 1.4; opacity: 0.5; }
.success h2 {
  font-family: var(--font-display);
  font-size: clamp(34px, 12vw, 52px);
  font-weight: 300;
  letter-spacing: 0.5px;
  margin: 0 0 10px;
  color: var(--ink);
}
.success h2 .p { color: var(--lime); }
.success p { margin: 0 auto; max-width: 320px; color: var(--ink-soft); font-size: 15px; line-height: 1.42; }

.foot {
  margin-top: 28px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.3px;
  color: var(--ink-soft);
}
.foot .pp { color: var(--peri); }

.hidden { display: none !important; }
