@layer components {
  /* ---------- кнопки ---------- */
  .btn { position: relative; isolation: isolate; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-pill); font-weight: 600; font-size: .9rem; line-height: 1.2; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); color: var(--fg); transition: border-color .2s, background .2s; cursor: pointer; }
  .btn-lg { padding: 16px 28px; font-size: 1rem; }
  .btn-primary { background: linear-gradient(180deg, #ffd957, var(--sun)); color: var(--ink-950); border-color: rgba(255,255,255,.35); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 10px 30px -10px rgba(var(--sun-rgb), .6); }
  a.btn, a.btn:hover, button.btn { text-decoration: none; color: var(--fg); }
  a.btn-primary, a.btn-primary:hover, button.btn-primary { color: var(--ink-950); } /* button.btn выше задаёт светлый текст — жёлтой кнопке нужен тёмный и в виде <button> */
  /* свечение при наведении — отдельный слой с анимацией только opacity. will-change держит слой постоянно: без него Chrome создавал слой при наведении и убирал при уходе, перекрашивая весь hero, и текст «вздрагивал» (проверено трассировкой 2026-10-22) */
  .btn-primary::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; z-index: -1; pointer-events: none; opacity: 0; will-change: opacity; transition: opacity .25s var(--ease); box-shadow: 0 0 36px rgba(var(--sun-rgb), .55); }
  .btn-primary:hover::after { opacity: 1; }
  :root[data-theme="light"] .btn-primary::after { display: none; }
  .btn-ghost:hover { border-color: var(--violet-400); background: rgba(255,255,255,.08); }
  .btn[aria-disabled="true"] { opacity: .6; cursor: default; }

  /* ---------- liquid glass ---------- */
  .glass { --c-rgb: var(--white-rgb); position: relative; isolation: isolate; border-radius: var(--radius); contain: paint;
    background: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.025) 55%, rgba(var(--c-rgb), .06));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)); backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 var(--glass-highlight), inset 0 -1px 0 rgba(255,255,255,.04), inset 0 0 40px rgba(var(--c-rgb), .05), 0 30px 80px -40px rgba(0,0,0,.9); }
  .glass::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
    background: radial-gradient(120% 70% at 18% -10%, rgba(255,255,255,.22), transparent 55%), radial-gradient(60% 40% at 90% 110%, rgba(var(--c-rgb), .18), transparent 60%); }
  .glass::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,.55), rgba(255,255,255,.05) 30%, transparent 55%, rgba(var(--c-rgb), .55));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude; }
  .glass .liquid { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; border-radius: inherit; }
  .glass .liquid::after { content: ""; position: absolute; top: -30%; bottom: -30%; left: -60%; width: 220%; will-change: transform;
    background: radial-gradient(28% 40% at 30% 30%, rgba(255,255,255,.14), transparent 70%), radial-gradient(24% 34% at 70% 70%, rgba(var(--c-rgb), .20), transparent 70%), linear-gradient(115deg, transparent 42%, rgba(255,255,255,.07) 50%, transparent 58%);
    animation: liquid 16s ease-in-out infinite alternate; }
  @keyframes liquid { from { transform: translate3d(-8%, -4%, 0) rotate(-2deg); } to { transform: translate3d(8%, 4%, 0) rotate(2deg); } }
  .glass .liquid::before { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .35s var(--ease);
    background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.16), rgba(var(--c-rgb), .12) 35%, transparent 70%); }
  .glass { transition: border-color .35s var(--ease), box-shadow .35s var(--ease), transform .35s var(--ease); }
  /* при наведении обводка остаётся одной линией: акцент — в самой рамке, без второго кольца через box-shadow 0 0 0 1px (заказчик, 2026-10-22) */
  .glass:hover { border-color: rgba(var(--c-rgb), .32); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), inset 0 0 60px rgba(var(--c-rgb), .08), 0 30px 80px -40px rgba(0,0,0,.9); }
  .glass:hover .liquid::before { opacity: 1; }
  .glass:hover .liquid::after { animation-duration: 7s; }
  .glass-pill { border-radius: var(--radius-pill); }
  .c-mint { --c-rgb: var(--mint-rgb); } .c-lime { --c-rgb: var(--lime-rgb); } .c-peach { --c-rgb: var(--peach-rgb); } .c-sun { --c-rgb: var(--sun-rgb); } .c-flame { --c-rgb: var(--flame-rgb); } .c-sky { --c-rgb: var(--sky-rgb); }
  @media (prefers-reduced-transparency: reduce) { .glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--ink-900); } .glass .liquid { display: none; } }
  @media (prefers-reduced-motion: reduce) { .glass .liquid::after { animation: none; } }
  @media (max-width: 900px) { :root { --glass-blur: 12px; --glass-saturate: 140%; } }

  /* ---------- неоновые пятна за стеклом (без filter: blur) ---------- */
  .orbs { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
  .orb { --o: var(--mint-rgb); position: absolute; border-radius: 50%; will-change: transform; width: 420px; height: 420px;
    background: radial-gradient(closest-side, rgba(var(--o), .42), rgba(var(--o), .18) 45%, rgba(var(--o), 0) 72%); animation: drift 22s ease-in-out infinite alternate; }
  .orb-mint { --o: var(--mint-rgb); } .orb-lime { --o: var(--lime-rgb); } .orb-flame { --o: var(--flame-rgb); } .orb-sun { --o: var(--sun-rgb); }
  .o1 { left: -5%; top: 10%; } .o2 { left: 40%; top: 50%; width: 360px; height: 360px; animation-delay: -8s; } .o3 { right: -8%; top: 5%; animation-delay: -14s; }
  .o4 { left: 20%; top: 0; width: 520px; height: 520px; opacity: .8; } .o5 { right: 5%; bottom: 0; width: 300px; height: 300px; opacity: .8; animation-delay: -10s; } .o6 { right: 10%; top: -20%; opacity: .7; }
  @keyframes drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(8vw, -6vh, 0) scale(1.25); } }
  @media (prefers-reduced-motion: reduce) { .orb { animation: none; } }

  /* ---------- уведомление о cookie (публичные страницы) ---------- */
  .cookie-banner { position: fixed; left: 50%; bottom: 16px; z-index: 30; width: min(760px, calc(100% - 32px)); transform: translateX(-50%);
    display: flex; align-items: center; gap: 18px; padding: 16px 18px 16px 22px; animation: cookie-in .4s var(--ease) both; }
  .cookie-banner[hidden] { display: none; }
  .cookie-banner p { margin: 0; font-size: .88rem; line-height: 1.45; color: var(--paper-dim); position: relative; z-index: 1; }
  .cookie-banner .btn { flex: none; position: relative; z-index: 1; }
  @keyframes cookie-in { from { opacity: 0; } }
  @media (max-width: 640px) { .cookie-banner { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 16px; bottom: 12px; } }
  @media (prefers-reduced-motion: reduce) { .cookie-banner { animation: none; } }

  /* ---------- шапка / подвал ---------- */
  .site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 20; padding-block: 12px; pointer-events: none; }
  .site-header .wrap { pointer-events: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 10px; padding-left: 22px; padding-right: 10px; background: rgba(19,13,36,.35); }
  .site-header .wrap:hover { transform: none; }
  .logo { font-family: var(--font-display); font-weight: 900; font-size: .95rem; letter-spacing: -.02em; line-height: .95; display: inline-block; }
  .logo .x { color: var(--mint); }
  .site-nav { display: flex; gap: 22px; font-size: .9rem; color: var(--fg-dim); }
  .site-nav a:hover { color: var(--fg); }
  .site-actions { display: flex; gap: 8px; }
  .site-footer { position: relative; z-index: 1; padding-block: 72px 40px; color: var(--fg-dim); font-size: .85rem; background: linear-gradient(180deg, transparent, rgba(0,0,0,.32)); }
  .site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 28px; align-items: start; }
  .site-footer p { margin: 12px 0 0; }
  .foot-nav { display: grid; gap: 8px; }
  .foot-nav a:hover { color: var(--fg); }
  .foot-meta code { color: var(--violet-400); }
  @media (max-width: 900px) { .site-nav { display: none; } .site-header .wrap { padding-left: 16px; } .site-header .wrap .btn-ghost { display: none; } .site-header .btn { padding: 9px 14px; font-size: .85rem; } .site-footer .wrap { grid-template-columns: 1fr; } }

  /* мобильное меню сайта (≤ 900 px): кнопка в капсуле шапки, панель — под капсулой (заказчик, 2026-10-24) */
  .menu-toggle { display: none; width: 40px; height: 40px; place-items: center; flex: none; padding: 0; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); color: var(--fg); cursor: pointer; }
  .menu-toggle .i-close, .menu-toggle[aria-expanded="true"] .i-open { display: none; }
  .menu-toggle[aria-expanded="true"] .i-close { display: block; }
  .site-menu { pointer-events: auto; max-width: var(--wrap); margin: 8px auto 0; padding-left: var(--gutter); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .site-menu[hidden] { display: none; }
  .site-menu-panel { display: grid; padding: 8px; border-radius: 22px; background: rgba(19,13,36,.95); box-shadow: 0 24px 60px -20px rgba(0,0,0,.8); animation: menu-in .18s var(--ease); } /* почти непрозрачная: текст страницы под меню не просвечивает */
  .site-menu-panel a:not(.btn) { padding: 11px 14px; border-radius: 12px; font-size: 1rem; color: var(--paper); }
  .site-menu-panel a:not(.btn):hover, .site-menu-panel a:not(.btn):focus-visible { background: rgba(255,255,255,.06); }
  .site-menu-panel .site-menu-login { margin-top: 8px; padding: 12px 18px; font-size: .95rem; }
  @keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } }
  @media (max-width: 900px) { .menu-toggle { display: grid; } }
  @media (min-width: 901px) { .site-menu { display: none; } }
  @media (prefers-reduced-motion: reduce) { .site-menu-panel { animation: none; } }
}

@layer components {
  /* ---------- формы ---------- */
  .form { display: grid; gap: 16px; }
  .form-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .field { display: grid; gap: 6px; min-width: 0; align-content: start; } /* без align-content сетка .grid-2 растягивала поле соседа, если под одним была подсказка или ошибка */
  .field label { font-size: .85rem; color: var(--fg-dim); font-weight: 500; }
  .field .req { color: var(--flame); }
  .input { width: 100%; font: inherit; color: var(--fg); background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius-sm); padding: 12px 14px; transition: border-color .2s, box-shadow .2s; min-width: 0; }
  .input:focus { outline: none; border-color: var(--mint); box-shadow: 0 0 0 3px rgba(var(--mint-rgb), .2); }
  .input:disabled { opacity: .6; }
  .input-sm { padding: 7px 10px; font-size: .85rem; }
  select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--fg-dim) 50%), linear-gradient(135deg, var(--fg-dim) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
  select.input option { color: #1a1230; background: #fff; }
  textarea.input { resize: vertical; min-height: 96px; }
  input[type="file"].input { padding: 10px; }
  .field-check label { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--fg); cursor: pointer; }
  .field-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--sun); flex: none; }
  .field-check a { color: var(--sun); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
  .field-check a:hover { color: var(--fg); text-decoration: underline; }
  /* поле с неизменяемым префиксом внутри («@» у юзернейма Telegram) */
  .input-affix { position: relative; }
  .input-affix .affix { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--fg-dim); pointer-events: none; }
  .input-affix .input { padding-left: 34px; }
  /* поиск вуза: выпадающие подсказки (public/js/uni-search.js). Плотная панель, не стекло — стекло к формам не применяем */
  .combo { position: relative; }
  .combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; max-height: 300px; overflow-y: auto; overscroll-behavior: contain;
    margin: 0; padding: 6px; list-style: none; background: var(--ink-900); border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius-sm);
    box-shadow: 0 24px 60px -20px rgba(0,0,0,.85); }
  .combo-list [role="option"] { display: grid; gap: 2px; padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: .92rem; line-height: 1.3; }
  .combo-list [role="option"] small { color: var(--fg-dim); font-size: .78rem; }
  .combo-list [role="option"][aria-selected="true"], .combo-list [role="option"]:hover { background: rgba(255,255,255,.08); }
  .combo-list .combo-other { margin-top: 4px; border-top: 1px solid rgba(255,255,255,.08); border-radius: 0 0 10px 10px; color: var(--sun); }
  .combo-list .combo-empty { padding: 9px 12px; color: var(--fg-dim); font-size: .85rem; }
  .field.is-error .input { border-color: var(--flame); }
  .field .error { color: var(--peach); font-size: .82rem; margin: 0; }
  .field .hint, .hint { color: var(--fg-dim); font-size: .82rem; margin: 0; }
  .form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
  .alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .92rem; border: 1px solid; margin-bottom: 18px; }
  .alert-success { border-color: rgba(118,254,197,.4); background: rgba(118,254,197,.08); color: var(--ok); }
  .alert-error { border-color: rgba(255,99,49,.5); background: rgba(255,99,49,.1); color: var(--peach); }
  .alert-info { border-color: rgba(104,213,255,.4); background: rgba(104,213,255,.08); color: var(--info); }
  .btn-sm { padding: 7px 14px; font-size: .82rem; }
  .badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-family: var(--font-data); font-size: .75rem; font-weight: 600; letter-spacing: .04em; border: 1px solid transparent; }
  .badge-sun { background: var(--sun); color: var(--ink-950); }
  .badge-status-applied { background: rgba(141,115,194,.2); color: var(--violet-200); border-color: rgba(141,115,194,.4); }
  .badge-status-participant { background: rgba(var(--mint-rgb), .15); color: var(--mint); border-color: rgba(var(--mint-rgb), .4); }
  .badge-status-prizewinner { background: rgba(var(--lime-rgb), .15); color: var(--lime); border-color: rgba(var(--lime-rgb), .4); }
  .badge-status-winner { background: var(--sun); color: var(--ink-950); }
  .badge-status-rejected { background: rgba(var(--flame-rgb), .15); color: var(--peach); border-color: rgba(var(--flame-rgb), .4); }
  .chip { display: inline-block; font-family: var(--font-data); font-size: .72rem; padding: 2px 8px; border-radius: 6px; background: rgba(127,127,127,.15); margin-right: 4px; }
  .muted { color: var(--fg-dim); }
  .ok { color: var(--ok); }
  .warn { color: var(--sun); }
  .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: rgb(var(--c-rgb, var(--mint-rgb))); box-shadow: 0 0 12px rgba(var(--c-rgb, var(--mint-rgb)), .7); margin-right: 8px; vertical-align: middle; }
  @media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
}

@layer components {
  /* таймер: шапка с «живой» точкой и датой рубежа, четыре плитки с разрядами и мигающие двоеточия */
  .timer { font-family: var(--font-data); padding: 18px 20px 20px; min-width: 0; }
  .timer-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
  .timer-head small { color: var(--mint); font-size: .74rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
  .timer-head time { margin-left: auto; color: var(--fg-dim); font-size: .8rem; white-space: nowrap; }
  .timer .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px rgba(var(--mint-rgb), .9); position: relative; flex: none; }
  .timer .pulse::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid rgba(var(--mint-rgb), .7); animation: pulse 2.2s ease-out infinite; }
  @keyframes pulse { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
  .digits { display: flex; align-items: stretch; gap: 6px; font-variant-numeric: tabular-nums; }
  .digits .cell { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px 6px 12px; border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.025)); box-shadow: inset 0 1px 0 rgba(255,255,255,.14), inset 0 -1px 0 rgba(0,0,0,.25); }
  .digits b { font-family: var(--font-display); font-size: clamp(1.7rem, 3.2vw, 2.5rem); font-weight: 700; line-height: 1; letter-spacing: -.03em; color: var(--fg); min-width: 2ch; text-align: center; }
  .digits .cell:first-child b { color: var(--mint); text-shadow: 0 0 24px rgba(var(--mint-rgb), .55); }
  .digits span { font-size: .7rem; color: var(--fg-dim); margin-top: 8px; letter-spacing: .04em; }
  .digits .secs b { color: var(--violet-200); }
  .digits .colon { flex: none; width: 6px; display: flex; flex-direction: column; justify-content: center; gap: 8px; align-self: center; height: 34px; }
  .digits .colon::before, .digits .colon::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--violet-400); animation: blink 1s steps(1) infinite; }
  @keyframes blink { 50% { opacity: .25; } }
  .timer.done .digits { opacity: .5; }
}
