/* ELITE HOUSE ENDURO CUP 2026 — передний номерной щит */

@font-face { font-family: "FSEC"; font-style: italic; font-weight: 900; font-display: swap; src: url(assets/fonts/fsec-latin-900-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF; }
@font-face { font-family: "FSEC"; font-style: italic; font-weight: 900; font-display: swap; src: url(assets/fonts/fsec-cyrillic-900-italic.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "FSEC"; font-style: italic; font-weight: 800; font-display: swap; src: url(assets/fonts/fsec-latin-800-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF; }
@font-face { font-family: "FSEC"; font-style: italic; font-weight: 800; font-display: swap; src: url(assets/fonts/fsec-cyrillic-800-italic.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "FSEC"; font-style: normal; font-weight: 800; font-display: swap; src: url(assets/fonts/fsec-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF; }
@font-face { font-family: "FSEC"; font-style: normal; font-weight: 800; font-display: swap; src: url(assets/fonts/fsec-cyrillic-800-normal.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "FSEC"; font-style: normal; font-weight: 700; font-display: swap; src: url(assets/fonts/fsec-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF; }
@font-face { font-family: "FSEC"; font-style: normal; font-weight: 700; font-display: swap; src: url(assets/fonts/fsec-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "FSEC"; font-style: normal; font-weight: 600; font-display: swap; src: url(assets/fonts/fsec-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF; }
@font-face { font-family: "FSEC"; font-style: normal; font-weight: 600; font-display: swap; src: url(assets/fonts/fsec-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "FSEC"; font-style: normal; font-weight: 500; font-display: swap; src: url(assets/fonts/fsec-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2190-21FF; }
@font-face { font-family: "FSEC"; font-style: normal; font-weight: 500; font-display: swap; src: url(assets/fonts/fsec-cyrillic-500-normal.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --yellow: #F7C809;
  --yellow-deep: #DEA30E;
  --ink: #121110;
  --vinyl: #ECE6DC;
  --vinyl-shade: #D9D0C2;
  --orange: #F14A08;
  --orange-hot: #FF5A00;
  --orange-ctl: #C93A04; /* оранжевый для кнопок с белым текстом, AA */
  --mud: #5B4630;
  --fork: #15130F;
  --ok: #1E7A3C;
  --err: #C62A0A;
  --font: "FSEC", "Arial Narrow", sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-slap: cubic-bezier(.34, 1.56, .64, 1);

  /* измеренная раскладка утверждённого макета, % от кадра 1344×752 */
  --r-board-x: 0%; --r-board-y: 0%; --r-board-w: 100%; --r-board-h: 100%;
  --r-numeral-x: 31.990%; --r-numeral-y: 30.320%; --r-numeral-w: 36.460%; --r-numeral-h: 46.540%;
  --r-title-1-x: 28.650%; --r-title-1-y: 5.320%; --r-title-1-w: 42.410%; --r-title-1-h: 12.230%;
  --r-title-2-x: 26.040%; --r-title-2-y: 18.090%; --r-title-2-w: 47.620%; --r-title-2-h: 10.640%;
  --r-nav-logo-x: 10.420%; --r-nav-logo-y: 2.930%; --r-nav-logo-w: 12.650%; --r-nav-logo-h: 4.790%;
  --r-nav-link-x: 78.130%; --r-nav-link-y: 3.460%; --r-nav-link-w: 12.280%; --r-nav-link-h: 3.990%;
  --r-sticker-eh-x: 2.080%; --r-sticker-eh-y: 28.190%; --r-sticker-eh-w: 28.650%; --r-sticker-eh-h: 25.930%;
  --r-sticker-eh-logo-x: 4.090%; --r-sticker-eh-logo-y: 32.580%; --r-sticker-eh-logo-w: 24.930%; --r-sticker-eh-logo-h: 17.950%;
  --r-sticker-gansi-x: 76.260%; --r-sticker-gansi-y: 30.320%; --r-sticker-gansi-w: 17.860%; --r-sticker-gansi-h: 25.530%;
  --r-sticker-rider-x: 1.790%; --r-sticker-rider-y: 59.310%; --r-sticker-rider-w: 30.650%; --r-sticker-rider-h: 25.530%;
  --r-rider-text-x: 11.160%; --r-rider-text-y: 64.890%; --r-rider-text-w: 19.720%; --r-rider-text-h: 12.230%;
  --r-sticker-partner-x: 67.340%; --r-sticker-partner-y: 58.240%; --r-sticker-partner-w: 30.510%; --r-sticker-partner-h: 27.260%;
  --r-partner-text-x: 77.750%; --r-partner-text-y: 64.890%; --r-partner-text-w: 17.490%; --r-partner-text-h: 11.970%;
  --r-sticker-date-x: 34.670%; --r-sticker-date-y: 78.990%; --r-sticker-date-w: 30.360%; --r-sticker-date-h: 11.700%;
  --r-date-text-x: 40.770%; --r-date-text-y: 80.850%; --r-date-text-w: 22.320%; --r-date-text-h: 7.450%;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scrollbar-width: thin; scrollbar-color: var(--orange) var(--fork); }
body {
  margin: 0;
  background: var(--fork);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
picture { display: block; }
::selection { background: var(--orange-hot); color: #fff; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
a { color: inherit; }

/* ─── Первый экран ─────────────────────────────────────────────── */
.stage {
  position: relative;
  min-height: min(100svh, 100vw * 752 / 1344);
  display: grid;
  place-items: center;
  background: var(--fork);
  overflow: hidden;
  isolation: isolate;
}

.plate {
  position: relative;
  container-type: inline-size;
  width: min(100%, 100svh * 1344 / 752);
  aspect-ratio: 1344 / 752;
}
.plate > * { position: absolute; margin: 0; }
.plate picture img, .r-nav-logo img { width: 100%; height: 100%; object-fit: contain; }
.r-sticker-eh-logo { object-fit: contain; }

.r-board { left: var(--r-board-x); top: var(--r-board-y); width: var(--r-board-w); height: var(--r-board-h); }
/* щит на весь экран: слой наклеек остаётся в пропорциях макета, а пластик выходит до краёв окна */
@media (min-width: 761px) and (orientation: landscape), (min-width: 1101px) {
  .r-board { left: calc(50% - 50vw); width: 100vw; top: 0; height: 100%; }
  .plate .r-board img { object-position: 50% 0; }
}
.plate .r-board img { object-fit: cover; }
.r-numeral { left: var(--r-numeral-x); top: var(--r-numeral-y); width: var(--r-numeral-w); height: var(--r-numeral-h); }
.r-sticker-eh { left: var(--r-sticker-eh-x); top: var(--r-sticker-eh-y); width: var(--r-sticker-eh-w); height: var(--r-sticker-eh-h); }
.r-sticker-eh picture { width: 100%; height: 100%; }
.r-sticker-eh-logo { left: var(--r-sticker-eh-logo-x); top: var(--r-sticker-eh-logo-y); width: var(--r-sticker-eh-logo-w); height: var(--r-sticker-eh-logo-h); padding: 1.6cqw 2.2cqw; --logo-ink: #1A1918; }
.r-sticker-gansi { left: var(--r-sticker-gansi-x); top: var(--r-sticker-gansi-y); width: var(--r-sticker-gansi-w); height: var(--r-sticker-gansi-h); }

.r-nav-logo { left: var(--r-nav-logo-x); top: var(--r-nav-logo-y); width: var(--r-nav-logo-w); height: var(--r-nav-logo-h); }
.r-nav-logo img { object-position: left center; --logo-ink: var(--ink); }
.r-nav-link {
  left: var(--r-nav-link-x); top: var(--r-nav-link-y); width: var(--r-nav-link-w); height: var(--r-nav-link-h);
  display: flex; align-items: center; justify-content: flex-end; gap: .6cqw;
  font-weight: 800; font-size: max(13px, 1.25cqw); text-decoration: none; color: var(--ink);
}
.r-nav-link svg { width: 1.6cqw; min-width: 14px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .3s var(--ease-out); }
.r-nav-link:hover svg { transform: translateX(4px); }

.title { position: static; font-style: italic; font-weight: 900; text-transform: uppercase; line-height: .82; letter-spacing: -.01em; color: var(--ink); }
.title span { position: absolute; display: flex; align-items: center; justify-content: center; white-space: nowrap; }
.r-title-1 { left: var(--r-title-1-x); top: var(--r-title-1-y); width: var(--r-title-1-w); height: var(--r-title-1-h); font-size: 8.9cqw; }
.r-title-2 { left: var(--r-title-2-x); top: var(--r-title-2-y); width: var(--r-title-2-w); height: var(--r-title-2-h); font-size: 7.15cqw; }

/* Роли — наклейки-кнопки */
.role { position: absolute; inset: 0; pointer-events: none; text-decoration: none; color: #fff; }
.role > * { position: absolute; pointer-events: auto; }
.r-sticker-rider { left: var(--r-sticker-rider-x); top: var(--r-sticker-rider-y); width: var(--r-sticker-rider-w); height: var(--r-sticker-rider-h); }
.r-sticker-partner { left: var(--r-sticker-partner-x); top: var(--r-sticker-partner-y); width: var(--r-sticker-partner-w); height: var(--r-sticker-partner-h); }
.r-rider-text { left: var(--r-rider-text-x); top: var(--r-rider-text-y); width: var(--r-rider-text-w); height: var(--r-rider-text-h); }
.r-partner-text { left: var(--r-partner-text-x); top: var(--r-partner-text-y); width: var(--r-partner-text-w); height: var(--r-partner-text-h); }
.r-rider-text, .r-partner-text { display: flex; flex-direction: column; justify-content: center; line-height: 1; padding-left: 0; color: #EEEDEC; }
.r-rider-text, .r-partner-text { rotate: -5deg; }
.r-rider-text { translate: -.4cqw .6cqw; }
.r-partner-text { translate: -.3cqw .5cqw; }
.role small { white-space: nowrap; }
.role b { font-style: normal; font-weight: 800; text-transform: uppercase; font-size: 4.05cqw; letter-spacing: -.01em; line-height: .95; }
.role small { font-weight: 600; font-size: 2.4cqw; margin-top: .3cqw; padding-left: .3cqw; }
.role picture, .role span { transition: transform .45s var(--ease-out), filter .45s var(--ease-out); }
.role:hover picture, .role:hover span,
.role:focus-visible picture, .role:focus-visible span { transform: translateY(-.5cqw) rotate(var(--hr, -1.2deg)) scale(1.025); }
.role:hover picture, .role:focus-visible picture { filter: drop-shadow(0 1.2cqw 1.2cqw rgba(40, 25, 0, .35)); }
.role--partner { --hr: 1.2deg; }
.role:active picture, .role:active span { transform: translateY(0) scale(.98); transition-duration: .1s; }
.role:focus-visible { outline: none; }
.role:focus-visible picture { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 1cqw; }

.date { position: absolute; inset: 0; pointer-events: none; }
.date .sep { margin: 0 .28em 0 .22em; }
.date > * { position: absolute; }
.r-sticker-date { left: var(--r-sticker-date-x); top: var(--r-sticker-date-y); width: var(--r-sticker-date-w); height: var(--r-sticker-date-h); }
.r-date-text {
  left: var(--r-date-text-x); top: var(--r-date-text-y); width: var(--r-date-text-w); height: var(--r-date-text-h);
  margin: 0; display: flex; align-items: center; justify-content: center; white-space: nowrap;
  font-style: italic; font-weight: 900; text-transform: uppercase; font-size: 2.85cqw; color: var(--ink); padding-left: 1.2cqw;
}

/* Наклейки «прилипают» при загрузке — одно движение на страницу */
@media (prefers-reduced-motion: no-preference) {
  .js .slap { animation: slap .7s var(--ease-slap) both; animation-delay: var(--d, 0s); }
  @keyframes slap {
    from { opacity: 0; transform: translateY(-1.5cqw) scale(1.18) rotate(var(--r, 0deg)); filter: drop-shadow(0 3cqw 2cqw rgba(0,0,0,.35)); }
    60% { opacity: 1; }
    to { opacity: 1; transform: none; filter: drop-shadow(0 0 0 rgba(0,0,0,0)); }
  }
}

/* ─── Анкета ───────────────────────────────────────────────────── */
.register {
  padding: clamp(56px, 9vw, 120px) 16px clamp(64px, 10vw, 140px);
  background: url(assets/plates/board.webp) center / cover no-repeat;
  background-color: var(--yellow);
  scroll-margin-top: 0;
}
.sheet {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  background: var(--vinyl);
  border-radius: 22px 30px 26px 18px;
  padding: clamp(28px, 4vw, 48px) clamp(20px, 4vw, 48px) clamp(28px, 4vw, 40px);
  box-shadow: 0 2px 0 var(--vinyl-shade), 0 18px 40px -12px rgba(50, 30, 0, .45);
  transform: rotate(-.6deg);
}
.sheet::after { /* подвёрнутый уголок */
  content: ""; position: absolute; right: 0; top: 0; width: 46px; height: 46px;
  background: linear-gradient(225deg, var(--yellow) 49%, #CBBFAE 50%, #F4EFE7 72%);
  border-radius: 0 30px 0 12px;
}
.sheet__title {
  margin: 0 0 22px; font-style: italic; font-weight: 900; text-transform: uppercase;
  font-size: clamp(34px, 5.2vw, 52px); line-height: .9; letter-spacing: -.01em; padding-right: 40px;
  text-wrap: balance;
}

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; background: #fff; border-radius: 14px; margin-bottom: 26px; }
.tabs button {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; border: 0; border-radius: 10px; cursor: pointer;
  font: italic 900 22px/1 var(--font); text-transform: uppercase; color: var(--ink); background: transparent;
  transition: background .25s var(--ease-out), color .25s var(--ease-out);
}
.tabs button:hover { background: #F3EEE6; }
.tabs button[aria-selected="true"] { background: var(--orange-ctl); color: #fff; }

.form { display: grid; gap: 20px; }
.field { margin: 0; padding: 0; border: 0; min-width: 0; }
.field[hidden] { display: none; }
.field > label, .field legend { display: block; margin: 0 0 8px; padding: 0; font-weight: 700; font-size: 17px; }
.field i { font-style: normal; font-weight: 500; color: #6B6257; }
.field input:not([type="radio"]), .field textarea, .phone {
  width: 100%; min-height: 56px; padding: 0 16px;
  font: 600 19px/1.3 var(--font); color: var(--ink);
  background: #fff; border: 2px solid #D8CFC1; border-radius: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { padding-top: 14px; padding-bottom: 14px; resize: vertical; min-height: 96px; }
.field input::placeholder, .field textarea::placeholder { color: #736A5E; }
.field input:focus, .field textarea:focus, .phone:focus-within { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(247, 200, 9, .55); }
.phone { display: flex; align-items: center; gap: 10px; padding: 0 0 0 16px; }
.phone span { font-weight: 700; color: #4A433B; }
.phone input { border: 0 !important; box-shadow: none !important; min-height: 52px !important; padding-left: 0 !important; background: transparent !important; }

.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: grid; place-items: center; min-height: 52px; padding: 0 8px;
  background: #fff; border: 2px solid #D8CFC1; border-radius: 999px;
  font-weight: 700; font-size: 18px; transition: background .2s, border-color .2s, color .2s, transform .2s var(--ease-out);
}
.chip:hover span { border-color: var(--ink); }
.chip input:checked + span { background: var(--orange-ctl); border-color: var(--orange-ctl); color: #fff; transform: rotate(-1.5deg); }
.chip input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }

.field__err { display: none; margin: 8px 0 0; font-weight: 600; font-size: 15px; color: var(--err); }
.field.is-invalid .field__err { display: block; }
.field.is-invalid input, .field.is-invalid .phone, .field.is-invalid .chip span { border-color: var(--err); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.submit {
  position: relative; min-height: 64px; margin-top: 4px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--orange-ctl); color: #fff;
  font: italic 900 clamp(20px, 2.6vw, 26px)/1 var(--font); text-transform: uppercase; letter-spacing: .01em;
  box-shadow: 0 2px 0 #8F2902, 0 12px 24px -10px rgba(120, 40, 0, .45);
  transition: transform .25s var(--ease-out), background .2s, box-shadow .25s var(--ease-out);
}
.submit:hover { background: #B23303; transform: translateY(-2px) rotate(-.4deg); }
.submit:active { transform: translateY(1px); box-shadow: 0 1px 0 #8F2902; }
.submit[disabled] { cursor: progress; background: #E7895F; box-shadow: none; transform: none; }
.submit[disabled] .submit__label::after { content: "…"; }
.form__err { margin: 0; font-weight: 700; color: var(--err); }
.form__note { margin: 0; font-size: 15px; color: #5E564C; }

/* Готово */
.sheet__done { display: none; text-align: center; padding: 18px 0 6px; }
.sheet[data-state="done"] .sheet__form { display: none; }
.sheet[data-state="done"] .sheet__done { display: block; }
.done__kicker { margin: 0 0 14px; font-weight: 700; font-size: 19px; color: var(--ok); }
.done__big {
  margin: 0 auto 18px; max-width: 12ch;
  font-style: italic; font-weight: 900; text-transform: uppercase;
  font-size: clamp(46px, 8vw, 78px); line-height: .88; letter-spacing: -.01em; text-wrap: balance;
}
.done__big span { display: inline-block; background: var(--ink); color: var(--yellow); padding: .04em .14em .02em; transform: rotate(-2deg); margin-bottom: .08em; }
.done__note { margin: 0 auto 26px; max-width: 34ch; font-size: 18px; line-height: 1.35; color: #4A433B; }
.again { border: 2px solid var(--ink); background: transparent; border-radius: 999px; min-height: 48px; padding: 0 22px; font: 700 17px/1 var(--font); cursor: pointer; }
.again:hover { background: var(--ink); color: var(--vinyl); }
@media (prefers-reduced-motion: no-preference) {
  .sheet[data-state="done"] .sheet__done { animation: slap .6s var(--ease-slap) both; }
}

.foot { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 16px 48px; background: var(--fork); color: #A79E92; font-size: 15px; text-align: center; }
.foot p { margin: 0; }
.foot__logo { width: 120px; --logo-ink: #EDE7DD; }

/* ─── Телефон и вертикальный планшет: щит собирается в колонку ── */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1100px) {
  .stage { display: block; min-height: auto; }
  .plate {
    width: 100%; aspect-ratio: auto; min-height: 100svh; container-type: inline-size;
    display: grid; grid-template-columns: 1fr 1fr; align-content: start; column-gap: 4cqw;
    grid-template-areas: "logo link" "title title" "num num" "eh gansi" "rider rider" "partner partner" "date date";
    padding: 16px max(16px, (100% - 600px) / 2) 32px;
  }
  .plate > * { position: relative; inset: auto; left: auto !important; top: auto !important; width: auto !important; height: auto !important; }
  .r-board { position: absolute !important; left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; z-index: 0; }
  .plate .r-board img { object-position: 50% 40%; }
  .plate > *:not(.r-board) { z-index: 1; }

  .r-nav-logo { grid-area: logo; height: 34px !important; align-self: center; }
  .r-nav-logo img { width: 128px; height: 34px; }
  .r-nav-link { grid-area: link; justify-content: flex-end; font-size: 16px; gap: 6px; min-height: 44px; }
  .r-nav-link svg { width: 16px; }

  .title { grid-area: title; display: grid; gap: .04em; margin: 5cqw 0 1cqw; text-align: center; }
  .title span { position: static; width: auto; height: auto; }
  .r-title-1 { font-size: min(13.6cqw, 84px); }
  .r-title-2 { font-size: min(10.2cqw, 64px); }

  .r-numeral { grid-area: num; justify-self: center; width: 76% !important; margin: -1cqw 0 -2cqw; }
  .r-sticker-eh { grid-area: eh; display: block; align-self: center; rotate: -2deg; }
  .r-sticker-eh-logo { grid-area: eh; align-self: center; justify-self: center; width: 76% !important; padding: 0; rotate: -2deg; }
  .r-sticker-gansi { grid-area: gansi; align-self: center; justify-self: center; width: 70% !important; }

  .role, .date { position: relative !important; inset: auto; pointer-events: auto; display: grid; }
  .role--rider { grid-area: rider; margin-top: 1cqw; }
  .role--partner { grid-area: partner; margin-top: -5cqw; }
  .date { grid-area: date; margin-top: -2cqw; }
  .role > *, .date > * { position: relative; left: auto !important; top: auto !important; width: 100% !important; height: auto !important; grid-area: 1 / 1; }
  .role picture img, .date picture img { height: auto; }
  .r-rider-text, .r-partner-text { justify-content: center; padding-left: 31%; translate: 0 0 !important; rotate: -4deg; }
  .role b { font-size: min(9.4cqw, 58px); }
  .role small { font-size: min(5.2cqw, 32px); margin-top: .1em; }
  .r-date-text { font-size: min(7cqw, 44px); padding-left: 11%; }
}
