/* EIWA · промокоды на баллы — мотивы Likato Professional (зелёный упаковки Rosemary, крем, глянцевые 3D-элементы кита),
   без логотипов. Токены — из сайта коллаборации (src/tokens.css). Только телефоны в приоритете. */

@font-face { font-family: "Onest"; font-style: normal; font-weight: 900; font-display: swap; src: url("fonts/onest-900.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/manrope-500.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/manrope-700.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/jetbrains-mono-500.woff2") format("woff2"); }

:root {
  --olive: #54822B;
  --olive-deep: #314D19;
  --olive-light: #97BD75;
  --sage: #EDF6E5;
  --cream: #FFFDF6;
  --pink: #FFA3D1;
  --error: #B3261E;

  --bg: var(--cream);
  --surface: #FFFFFF;
  --text: #1C1C1C;
  --text-2: #5B564F;
  --line: rgba(28, 28, 28, .14);
  --line-strong: rgba(28, 28, 28, .32);

  --f-display: "Onest", "Arial Black", "Segoe UI", system-ui, sans-serif;
  --f-text: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: 16px;
  --radius: 16px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 500 clamp(.9375rem, 4vw, 1.0625rem)/1.4 var(--f-text);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--f-mono); letter-spacing: .08em; }

/* ---------- фон: три глянцевых элемента из кита Likato, тихо плавают по краям ---------- */
.decor { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.sprite {
  position: absolute; display: block;
  background: url("img/brand3d.webp") no-repeat;
  will-change: transform;
  animation: float 9s ease-in-out infinite alternate;
}
.sprite--a { --w: clamp(120px, 34vw, 200px); top: -3%; right: -9%; --r: 14deg; }
.sprite--b { --w: clamp(96px, 27vw, 160px); bottom: 3%; left: -8%; --r: -12deg; animation-duration: 11s; animation-delay: -4s; }
@keyframes float {
  from { transform: translate3d(0, 0, 0) rotate(var(--r)); }
  to { transform: translate3d(0, -14px, 0) rotate(calc(var(--r) + 6deg)); }
}

/* ---------- раскладка ---------- */
.page {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  width: 100%; max-width: 440px; margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
}
.step { display: flex; flex-direction: column; animation: rise .45s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.eyebrow {
  margin: 0 0 14px;
  font: 500 .75rem/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--olive-deep);
}
h1 {
  margin: 0;
  font: 900 clamp(2rem, 9.4vw, 2.75rem)/1.02 var(--f-display);
  letter-spacing: .005em;
  color: var(--olive-deep);
  outline: none;
}
.lead { margin: 12px 0 0; color: var(--text-2); max-width: 30ch; }
.note { margin: 10px 0 0; color: var(--text-2); font-size: .875rem; }

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

/* ---------- промокод: шесть клеток поверх одного настоящего поля ---------- */
.code { position: relative; display: block; }
.code__input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0;
  font-size: 16px; /* иначе iOS увеличивает страницу при фокусе */
  caret-color: transparent;
}
.code__cells { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code__cells b {
  display: grid; place-items: center;
  aspect-ratio: 4 / 5; min-height: 52px;
  border: 1.5px solid var(--line-strong); border-radius: 12px;
  background: var(--surface);
  font: 500 clamp(1.375rem, 7vw, 1.75rem)/1 var(--f-mono);
  color: var(--text);
  transition: border-color .15s, background-color .15s, transform .15s;
}
.code__cells b.is-filled { border-color: var(--olive); background: var(--sage); }
.code.is-focused .code__cells b.is-current { border-color: var(--olive-deep); box-shadow: 0 0 0 3px rgba(84, 130, 43, .22); }
.code.is-focused .code__cells b.is-current:empty::after { content: ""; width: 2px; height: 1.1em; background: var(--olive-deep); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.code.is-error .code__cells b { border-color: var(--error); background: #FFF6F5; }
.code.is-shake { animation: shake .36s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ---------- телефон ---------- */
.field__input {
  width: 100%; height: 60px;
  padding: 0 18px;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface);
  font: 500 1.25rem/1 var(--f-mono); letter-spacing: .02em;
  font-size: max(16px, 1.25rem);
  transition: border-color .15s, box-shadow .15s;
}
.field__input::placeholder { color: #A8A29A; }
.field__input:focus { outline: none; border-color: var(--olive-deep); box-shadow: 0 0 0 3px rgba(84, 130, 43, .22); }
.field.is-error .field__input { border-color: var(--error); }

/* ---------- сообщения и кнопки ---------- */
.msg { min-height: 1.4em; margin: 10px 0 6px; font-size: .875rem; color: var(--error); }
.msg:empty { min-height: 0; margin: 6px 0 2px; }
.msg a { color: inherit; font-weight: 700; }

.btn {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 56px; margin-top: 8px;
  padding: 0 24px;
  border: 0; border-radius: 999px;
  background: var(--olive); color: #FFF;
  font: 700 1.0625rem/1 var(--f-text);
  cursor: pointer;
  transition: background-color .15s, transform .1s, opacity .15s;
}
.btn:active { transform: scale(.98); background: var(--olive-deep); }
.btn:focus-visible { outline: 3px solid var(--olive-deep); outline-offset: 3px; }
.btn:disabled { opacity: .38; cursor: default; transform: none; background: var(--olive); }
.btn.is-loading { color: transparent; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 22px; height: 22px;
  border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #FFF; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn--ghost { background: transparent; color: var(--olive-deep); box-shadow: inset 0 0 0 1.5px var(--olive); margin-top: 32px; }
.btn--ghost:active { background: var(--sage); }

.back {
  align-self: flex-start;
  margin: 0 0 22px; padding: 10px 0; min-height: 44px;
  border: 0; background: none; cursor: pointer;
  font-weight: 700; font-size: .9375rem; color: var(--olive-deep);
}
.fine { margin: 16px 0 0; font-size: .8125rem; color: var(--text-2); text-align: center; }

/* ---------- номинал ---------- */
.amount { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; color: var(--olive); }
.amount__num { font: 900 clamp(3.5rem, 19vw, 5rem)/.9 var(--f-display); letter-spacing: -.01em; }
.amount__unit { font: 900 clamp(1.25rem, 6vw, 1.625rem)/1 var(--f-display); }

#step-done .amount__num { animation: pop .6s cubic-bezier(.3, 1.6, .5, 1) .1s both; }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }

@media (min-width: 768px) {
  .page { max-width: 460px; }
  .sprite--a { right: 6%; top: 8%; }
  .sprite--b { left: 7%; bottom: 10%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
