/*
 * /apply — лендинг-форма kiki.tours.
 * Pixel-perfect к Figma фрейму 651:736 (360×738 mobile).
 * На широких экранах форма центрируется (max-width 360px).
 */

/* Self-hosted Montserrat — cyrillic + latin subsets, weights 400/600/700.
   Один файл на subset, поскольку Google Fonts отдаёт variable font, в
   котором все три веса лежат внутри. */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/apply/fonts/montserrat-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/apply/fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --pink-primary: #DB6285;     /* CTA fill, логотип, primary акцент */
  --pink-deep: #B63A5E;        /* акцент в логотипе */
  --burgundy-text: #743C45;    /* заголовок, label чекбокса, value текст */
  --pink-subtitle: #C15F76;    /* подзаголовок */
  --pink-line: #F7A5B8;        /* обводка input/checkbox */
  --pink-line-soft: #F6A4B8;   /* декоративные SVG, error bg */
  --pink-bg: #FFEFF0;          /* fill input/checkbox */
  --cta-stroke: #EFA6B7;       /* обводка CTA */
  --error-text: #FF0028;       /* текст в banner ошибок */
  --white: #FFFFFF;

  --font-sans: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html,
body {
  background: var(--white);
  color: var(--burgundy-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: var(--font-sans);
  min-height: 100%;
}

body {
  display: flex;
  justify-content: center;
  background-color: var(--white);
}

.apply-page {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  padding: 16px 16px 32px;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

/* Декорация — два отдельных <img> с полными path'ами из Figma.
   Положение задаётся явно через top/left/bottom — можно подвинуть
   прямо в DevTools (Inspect → .decor-top или .decor-bottom →
   меняй top/left/transform/width, изменения видны сразу).
   width 112% — пути слегка выходят за границы формы для визуального
   эффекта «выхода за рамки», как в Figma. */
.decor {
  position: absolute;
  width: 112%;
  height: auto;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.decor-top {
  top: -150px;
  left: 0;
}

.decor-bottom {
  bottom: 20px;
  left: 0;
}

/* Контент карточки кладётся поверх декора (z-index:1 в isolate'd
   контексте). */
.apply-page > *:not(.decor) {
  position: relative;
  z-index: 1;
}

/* Хедер с маленьким логотипом-бантиком (33×32 в Figma). */
.apply-header {
  height: 64px;
  display: flex;
  align-items: center;
}

.apply-logo {
  width: 33px;
  height: 32px;
  display: block;
}

/* Карточка с формой. Frame 407 (328×549) внутри Frame 408 в Figma. */
.apply-card {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
}

.apply-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 24px;
  line-height: 29px;
  color: var(--burgundy-text);
  text-transform: uppercase;
  letter-spacing: 0;
}

.apply-subtitle {
  margin-top: 8px;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 20px;
  color: var(--pink-subtitle);
}

.apply-form {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
}

/* Frame 424: 5 inputов 36px + 1 чекбокс 28px, gap=12 (приблиз. из 268
   общая высота — 5×36 — 28 = 60, делим на 5 промежутков). */
.apply-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: block;
  position: relative;
}

.field-input {
  display: block;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  background: var(--pink-bg);
  border: 1.5px solid var(--pink-line);
  border-radius: 8px;
  color: var(--burgundy-text);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 20px;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  appearance: none;
  outline: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.field-input::placeholder {
  color: var(--burgundy-text);
  opacity: 0.6;
}

.field-input:focus-visible {
  border-color: var(--pink-primary);
}

/* Hide native number spinners — input type=number ugly arrows. */
.field-input[type="number"]::-webkit-outer-spin-button,
.field-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Error-state поля: на тёмно-розовом bg (Figma вариант 649:388 / 649:558). */
.field.is-error .field-input {
  background: var(--pink-line-soft);
  border-color: var(--pink-line);
}

.field.is-error .field-input::placeholder {
  color: var(--burgundy-text);
  opacity: 0.85;
}

/* Кастомный чекбокс. Нативный input скрываем визуально, но оставляем
   доступным с клавиатуры; рисуем 26×26 квадрат с галочкой через SVG. */
.checkbox {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 12px;
  align-items: start;
  cursor: pointer;
  user-select: none;
}

.checkbox-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.checkbox-box {
  width: 26px;
  height: 26px;
  background: var(--pink-bg);
  border: 1.95px solid var(--pink-line);
  border-radius: 5.2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.checkbox-box svg {
  width: 18px;
  height: 13px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.checkbox-input:checked + .checkbox-box {
  background: var(--pink-primary);
  border-color: var(--pink-primary);
}

.checkbox-input:checked + .checkbox-box svg {
  opacity: 1;
}

.checkbox-input:focus-visible + .checkbox-box {
  outline: 2px solid var(--pink-primary);
  outline-offset: 2px;
}

.checkbox-label {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 12px;
  line-height: 15px;
  color: var(--burgundy-text);
  padding-top: 5px;
}

/* Honeypot — невидимое поле для ловли наивных ботов. */
.honey {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  pointer-events: none;
}

/* Cloudflare Turnstile в режиме invisible не рисует виджет в DOM,
   контейнер — pixel-точка. Скрываем чтобы не занимал место. */
.cf-turnstile {
  display: none;
}

/* Frame 431: actions block (banner + CTA). */
.apply-actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Banner ошибки (Figma Frame 444 в варианте 649:558).
   Шире самой формы: вытягиваем за padding страницы (-16px по краям). */
.form-banner {
  margin: 0 -16px;
  padding: 8px 16px;
  background: var(--pink-line-soft);
  color: var(--error-text);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  line-height: 15px;
  text-align: center;
}

.form-banner[hidden] {
  display: none;
}

/* Frame 338 — primary CTA. Pill-радиус (32px), inset stroke 1.15 #EFA6B7. */
.apply-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 45px;
  padding: 0 24px;
  background: var(--pink-primary);
  border: 1.15px solid var(--cta-stroke);
  border-radius: 32px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.apply-submit-label {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 16px;
  line-height: 20px;
  color: var(--white);
}

.apply-submit:hover {
  filter: brightness(1.04);
}

.apply-submit:active {
  transform: translateY(1px);
}

.apply-submit:focus-visible {
  outline: 3px solid var(--pink-primary);
  outline-offset: 3px;
}

.apply-submit:disabled {
  cursor: progress;
  filter: brightness(0.92);
}

/* Reduced motion — никаких микро-анимаций. */
@media (prefers-reduced-motion: reduce) {
  .field-input,
  .checkbox-box,
  .checkbox-box svg,
  .apply-submit {
    transition: none;
  }
}
