/* Day of Vocational Education registration. Brand: «Система СПО» + DAPR.
   Tokens: navy #113A59 text/hero, blue #0095FF accent, action #0068C9 (AA on white text),
   sky #58D8FF, orange #FF7700, yellow #FFE600. Montserrat only. 8px grid, radius 12/8. */

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('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('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+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --navy: #113A59;
  --blue: #0095FF;
  --action: #0068C9;
  --action-hover: #00579F;
  --sky: #58D8FF;
  --orange: #FF7700;
  --yellow: #FFE600;
  --bg: #F2F5F9;
  --card: #FFFFFF;
  --line: #D6E0EA;
  --muted: #56697B;
  --error: #C62828;
  --error-bg: #FDECEC;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(17, 58, 89, .06), 0 8px 24px rgba(17, 58, 89, .08);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--navy);
  background: var(--bg);
}
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 16px; }

/* Header */
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar__inner { display: flex; align-items: center; gap: 16px; min-height: 72px; }
.logo { display: block; height: 40px; width: auto; }
.topbar__divider { width: 1px; height: 32px; background: var(--line); }

/* Hero with the brand staircase motif */
.hero {
  position: relative;
  overflow: hidden;
  background-color: var(--navy);
  background-image: url('img/stairs.svg');
  background-repeat: no-repeat;
  background-size: 112px auto;
  background-position: right -28px bottom -34px;
  color: #fff;
}
.hero__inner { position: relative; padding-top: 28px; padding-bottom: 44px; }
.hero__eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sky);
}
.hero__title { margin: 0; font-size: 25px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.hero__date { display: block; margin-top: 8px; font-size: 20px; font-weight: 600; color: var(--yellow); }

/* Card */
.main { padding-top: 0; padding-bottom: 40px; }
.card {
  position: relative;
  margin-top: -16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 16px;
}
.group { border: 0; margin: 0 0 24px; padding: 0; min-width: 0; }
.group__title { margin: 0 0 16px; padding: 0; font-size: 18px; font-weight: 700; line-height: 1.3; }

/* Event checkbox cards */
.events { display: grid; gap: 12px; }
.event {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 44px;
  padding: 16px 56px 16px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.event::before {
  content: '';
  position: absolute;
  left: -2px; top: -2px; bottom: -2px;
  width: 6px;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--blue);
}
.event:nth-child(2)::before { background: var(--orange); }
.event input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.event:hover { border-color: #9DB6CC; }
.event:has(input:checked) { border-color: var(--action); background: #F0F7FF; }
.event:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(0, 104, 201, .3); }
.event__check {
  position: absolute; top: 16px; right: 16px;
  width: 26px; height: 26px;
  border: 2px solid #9DB6CC; border-radius: 7px; background: #fff;
}
.event input:checked + .event__check { background: var(--action); border-color: var(--action); }
.event input:checked + .event__check::after {
  content: ''; position: absolute; left: 7px; top: 2px; width: 7px; height: 13px;
  border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.event__time { font-size: 22px; font-weight: 700; line-height: 1.2; }
.event__title { font-weight: 600; line-height: 1.35; }
.event__place { color: var(--muted); font-size: 15px; }
.event__note {
  align-self: flex-start;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #FFF6CC;
  font-size: 14px;
  font-weight: 600;
}

/* Fields */
.row { display: grid; gap: 0 16px; }
.field { margin-bottom: 16px; min-width: 0; }
.field label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; }
input[type=text], input[type=email], input[type=tel], select {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  font: inherit;
  color: var(--navy);
  background: #fff;
  border: 1.5px solid #B8C7D5;
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23113A59' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  text-overflow: ellipsis;
}
select:invalid, select option[value=''] { color: #7C8DA0; }
select option { color: var(--navy); }
input::placeholder { color: #8FA0B2; }
input:focus, select:focus { outline: none; border-color: var(--action); box-shadow: 0 0 0 3px rgba(0, 104, 201, .2); }
.is-invalid input, .is-invalid select, input.is-invalid { border-color: var(--error); }
.error { margin: 6px 0 0; font-size: 14px; color: var(--error); font-weight: 500; }
.error:empty { display: none; }
.group .error#err-events { margin-top: 10px; }
.is-invalid .event { border-color: #E9A5A5; }

/* Honeypot: off-screen, not display:none (some bots skip hidden fields) */
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Consent */
.consent { margin: 8px 0 24px; padding: 16px; border-radius: var(--radius-sm); background: var(--bg); }
.checkbox { position: relative; display: flex; gap: 12px; align-items: flex-start; min-height: 44px; cursor: pointer; font-weight: 600; }
.checkbox input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.checkbox__box {
  flex: none; position: relative; width: 24px; height: 24px; margin-top: 0;
  border: 2px solid #9DB6CC; border-radius: 6px; background: #fff;
}
.checkbox input:checked + .checkbox__box { background: var(--action); border-color: var(--action); }
.checkbox input:checked + .checkbox__box::after {
  content: ''; position: absolute; left: 6px; top: 1px; width: 7px; height: 13px;
  border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.checkbox input:focus-visible + .checkbox__box { box-shadow: 0 0 0 3px rgba(0, 104, 201, .3); }
.consent.is-invalid .checkbox__box { border-color: var(--error); }
.consent__details { margin-left: 36px; font-size: 14px; }
.consent__details summary { cursor: pointer; color: var(--action); font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
.consent__text { color: var(--muted); line-height: 1.5; }
.consent__text p { margin: 8px 0 0; }

/* Button */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 54px; padding: 14px 24px;
  font: inherit; font-size: 17px; font-weight: 700;
  color: #fff; background: var(--action);
  border: 0; border-radius: var(--radius-sm);
  cursor: pointer; transition: background-color .15s, transform .05s;
}
.button:hover { background: var(--action-hover); }
.button:active { transform: translateY(1px); }
.button:focus-visible { outline: 3px solid rgba(0, 104, 201, .35); outline-offset: 2px; }
.button[disabled] { opacity: .7; cursor: progress; }
.button__spinner {
  display: none; width: 18px; height: 18px;
  border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%;
  animation: spin .8s linear infinite;
}
.button.is-loading .button__spinner { display: inline-block; }
.button--secondary { color: var(--action); background: #fff; border: 2px solid var(--action); }
.button--secondary:hover { background: #F0F7FF; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-error {
  margin: 0 0 16px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--error-bg); color: var(--error); font-weight: 600;
}

/* Success */
.done { text-align: center; padding-top: 32px; padding-bottom: 32px; outline: none; }
.done__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%; background: #E3F5EA; color: #1E8E4E;
}
.done__title { margin: 16px 0 8px; font-size: 24px; }
.done__text { margin: 0 auto 24px; max-width: 520px; color: var(--muted); }
.done__text strong { color: var(--navy); overflow-wrap: anywhere; }
.done__events { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; text-align: left; }
.done__events li { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--bg); border-left: 5px solid var(--blue); }
.done__events li + li { border-left-color: var(--orange); }
.done__events b { display: block; font-size: 18px; }
.done__events span { display: block; color: var(--muted); font-size: 15px; }

.footer { padding: 24px 0 32px; color: var(--muted); font-size: 13px; text-align: center; }

@media (min-width: 640px) {
  .wrap { padding: 0 24px; }
  .logo { height: 48px; }
  .hero { background-size: 280px auto; background-position: right -40px bottom -60px; }
  .hero__inner { padding-top: 40px; padding-bottom: 56px; padding-right: 220px; }
  .hero__title { font-size: 34px; }
  .hero__date { font-size: 24px; }
  .card { padding: 32px; margin-top: -24px; }
  .events { grid-template-columns: 1fr 1fr; }
  .row { grid-template-columns: 1fr 1fr; }
  .row .field--age { max-width: 160px; }
  .row:has(.field--age) { grid-template-columns: 140px 1fr; }
  .button { width: auto; min-width: 280px; }
  .done .button { min-width: 0; }
}
@media (min-width: 1024px) {
  .hero { background-size: 340px auto; background-position: right calc(50% - 560px) bottom -80px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Links in consent/footer and the policy document */
.checkbox a, .footer a { color: var(--action); font-weight: 600; }
.footer a { font-weight: 500; }
.topbar__home { display: block; }
.main--doc { padding-top: 24px; }
.main--doc .card { margin-top: 0; }
.doc { max-width: 760px; margin: 0 auto; }
.doc h1 { margin: 0 0 8px; font-size: 26px; line-height: 1.25; }
.doc__lead { margin: 0 0 24px; color: var(--muted); }
.doc h2 { margin: 28px 0 8px; font-size: 18px; }
.doc p, .doc li { line-height: 1.6; }
.doc p { margin: 0 0 12px; }
.doc ul { margin: 0 0 12px; padding-left: 22px; }
.doc a { color: var(--action); overflow-wrap: anywhere; }
.doc__consent { padding: 16px; border-radius: var(--radius-sm); background: var(--bg); color: var(--muted); font-size: 15px; }
.doc__consent p:last-child { margin-bottom: 0; }
.doc__back { margin: 28px 0 0; font-weight: 600; }
