/* Олимпиадика: оформление кабинетов и служебных страниц поверх стилей платформы.
   Тот же язык, что на главной: Nunito, небо и кремовый фон, объёмные кнопки и карточки с «полочкой». */
:root {
  --oly-ink: #2b1d3f; --oly-ink-2: #5b4d6e; --oly-purple: #6744d4; --oly-purple-2: #7f5ce6; --oly-purple-dark: #4a2f99;
  --oly-cream: #fbf6ee; --oly-paper: #fffdf8; --oly-line: #eadff0; --oly-ledge: #c9b9d8; --oly-sun: #ffd05e; --oly-gold: #f5b72a;
  --oly-teal: #20bfbd; --oly-coral: #ff8b62; --oly-sky: #6fc9f7;
  --oly-font: Nunito, ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --oly-page: linear-gradient(180deg, #cdeafd 0, #e6f5ff 180px, #fbf6ee 520px) no-repeat #fbf6ee;
}

/* ---------- основа ---------- */
html body, body button, body input, body select, body textarea { font-family: var(--oly-font); }
html body { color: var(--oly-ink); font-weight: 600; font-synthesis: none; background: var(--oly-page); }
body h1, body h2, body h3 { font-weight: 900; letter-spacing: -.02em; color: var(--oly-ink); }
body ::selection { background: #ffe08a; color: var(--oly-ink); }
body a:focus-visible, body button:focus-visible, body summary:focus-visible { outline: 3px solid #ffb84d; outline-offset: 3px; }

/* фон страниц, у которых он задан своим блоком */
body.registration-page, body.student-page, body.family-page, body.dashboard-page, body.profile-page,
body .landing-page, body .registration-choice-page, body.help-page { background: var(--oly-page); }

/* ---------- кнопки ---------- */
body .btn, body input.btn, body .oly-btn, body .primary-button, body .pf-save:not(:disabled), body .help-button:not(.is-light), body .header-register {
  border: 0; border-radius: 16px; color: #fff; font-weight: 800; letter-spacing: 0;
  background: linear-gradient(180deg, #8d6cf0, #6744d4);
  box-shadow: inset 0 2px 0 #ffffff55, inset 0 -3px 0 #00000018, 0 4px 0 var(--oly-purple-dark), 0 8px 14px #3a206e2b;
  transition: transform .12s ease, box-shadow .12s ease, filter .2s;
}
body .btn:hover:not(:disabled), body input.btn:hover:not(:disabled), body .oly-btn:hover, body .primary-button:hover, body .header-register:hover, body .help-button:not(.is-light):hover {
  background: linear-gradient(180deg, #8d6cf0, #6744d4); filter: brightness(1.06); transform: none;
  box-shadow: inset 0 2px 0 #ffffff55, inset 0 -3px 0 #00000018, 0 4px 0 var(--oly-purple-dark), 0 8px 14px #3a206e2b;
}
body .btn:active:not(:disabled), body input.btn:active:not(:disabled), body .oly-btn:active, body .primary-button:active, body .header-register:active {
  transform: translateY(3px); box-shadow: inset 0 2px 0 #ffffff55, 0 1px 0 var(--oly-purple-dark), 0 3px 6px #3a206e2b;
}
body .btn.btn-secondary, body .btn.btn-quiet, body .oly-btn--light, body .header-login, body .back-control, body .back-button, body .help-button.is-light {
  border: 0; border-radius: 16px; color: var(--oly-ink); font-weight: 800;
  background: linear-gradient(180deg, #fffdf8, #f1e9f6);
  box-shadow: inset 0 2px 0 #fff, 0 4px 0 var(--oly-ledge), 0 8px 14px #39245218;
}
body .btn.btn-secondary:hover:not(:disabled), body .btn.btn-quiet:hover:not(:disabled), body .oly-btn--light:hover, body .header-login:hover, body .back-control:hover, body .back-button:hover {
  background: linear-gradient(180deg, #fff, #f6effa); filter: none; box-shadow: inset 0 2px 0 #fff, 0 4px 0 var(--oly-ledge), 0 8px 14px #39245218;
}
.oly-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 26px 3px; font-size: 18px; line-height: 1; text-decoration: none; cursor: pointer; }
.oly-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- поля ---------- */
body main input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=hidden]):not([type=file]),
body main select, body main textarea {
  border: 2px solid #e1d4ec; border-radius: 14px; background-color: #fff; color: var(--oly-ink); font-weight: 700;
}
body main input:focus, body main select:focus, body main textarea:focus { border-color: var(--oly-purple-2) !important; box-shadow: 0 0 0 4px #7f5ce633 !important; outline: none; }
body main input::placeholder, body main textarea::placeholder { color: #a99bb8; font-weight: 600; }
body input[type=checkbox], body input[type=radio] { accent-color: var(--oly-purple); }

/* ---------- карточки ---------- */
body .registration-card, body .login-card, body .empty-state, body .pf-card, body .pf-head, body .registration-role,
body .legal-card, body .child-selection-tile, body .help-card, body .round-start .start-intro {
  border: 1px solid #fff9ee; border-radius: 26px;
  box-shadow: inset 0 2px 3px #ffffffc4, 0 5px 0 var(--oly-ledge), 0 14px 26px #39245220;
}
body .registration-card, body .login-card, body .empty-state, body .pf-card, body .legal-card { background: linear-gradient(165deg, #fffdf8, #f8f1f7); }

/* ---------- шапка гостевых страниц ---------- */
body .public-navigation-bar, body .simple-header, body .student-header.account-header {
  background: #fffffff2; border-bottom: 1px solid #cfe5f4; box-shadow: inset 0 1px 0 #fff, 0 10px 26px #1f6a9a1f;
}
body .brand .brand-description { color: #36607f; font-weight: 700; border-left-color: #e3eff8; }
body .header-login, body .header-register { min-height: 44px; padding: 0 20px 2px; border-radius: 14px; font-size: 16px; display: inline-flex; align-items: center; }

/* ---------- кабинет учителя ---------- */
body .teacher-shell, body .rails-teacher-shell { background: var(--oly-page); }
body .rails-teacher-shell .teacher-sidebar, body .rails-teacher-shell .teacher-sidebar > div {
  background: linear-gradient(180deg, #5a3bc4 0, #4a2f99 55%, #3d2684 100%); color: #e9e2ff;
}
body .rails-teacher-shell .desktop-sidebar { border-right: 0; box-shadow: 4px 0 0 #36207a, 10px 0 24px #3a206e26; }
body .rails-teacher-shell .teacher-sidebar [data-slot=sidebar-menu-button] { color: #e9e2ff; border-radius: 14px; font-weight: 800; }
body .rails-teacher-shell .teacher-sidebar [data-slot=sidebar-menu-button]:hover { background: #ffffff1f; color: #fff; }
body .rails-teacher-shell .teacher-sidebar [data-slot=sidebar-menu-button][data-active=true] {
  background: #fffdf8; color: var(--oly-purple-dark); box-shadow: 0 3px 0 #2f1b6e;
}
body .rails-teacher-shell .teacher-sidebar .nav-count { background: #ffffff2e; color: #fff; }
body .rails-teacher-shell .teacher-sidebar [data-active=true] .nav-count { background: #ece4ff; color: var(--oly-purple-dark); }
body .rails-teacher-shell .teacher-sidebar .teacher-nav-category { color: #c9bbf5; font-weight: 900; }
body .rails-teacher-shell .teacher-sidebar nav { border-color: #ffffff26; }
body .rails-teacher-shell .teacher-sidebar .teacher-olympiad-heading { color: #fff; }
body .rails-teacher-shell .teacher-sidebar .teacher-olympiad-heading small { color: #d9cdfb; font-weight: 700; }
body .rails-teacher-shell .teacher-sidebar .icon-box { background: #ffffff24; color: var(--oly-sun); }
body .rails-teacher-shell .sidebar-toggle { color: #d9cdfb; }
body .rails-teacher-shell .sidebar-toggle:hover { background: #ffffff1f; }
.teacher-olympiad-soon { display: flex; align-items: center; gap: 12px; padding: 10px; margin-top: 4px; border-radius: 14px; opacity: .78; cursor: default; }
.teacher-olympiad-soon .teacher-olympiad-copy { display: grid; gap: 1px; min-width: 0; }
.teacher-olympiad-soon strong { font-size: 14px; font-weight: 800; color: #fff; line-height: 1.25; }
.teacher-olympiad-soon small { font-size: 12px; color: #d9cdfb; font-weight: 700; }
.teacher-olympiad-soon i { font-style: normal; font-size: 9.5px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; padding: 2px 5px; border-radius: 6px; background: #ffffff2e; color: #fff; vertical-align: 2px; white-space: nowrap; }
.teacher-olympiad-soon .icon-box { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: #d9cdfb !important; }
body .rails-teacher-shell.is-collapsed .desktop-sidebar .teacher-olympiad-soon { justify-content: center; padding-inline: 0; }
body .rails-teacher-shell .dashboard-header { background: #fffffff2; border-bottom: 1px solid #cfe5f4; box-shadow: 0 8px 22px #1f6a9a14; }
body .rails-teacher-shell .teacher-avatar, body .student-ava { background: #ece4ff; color: var(--oly-purple); font-weight: 900; }
body .olymp-promo { border-radius: 26px; background: linear-gradient(120deg, #62c2f5 0%, #7f9cf0 45%, #7f5ce6 100%); box-shadow: inset 0 2px 0 #ffffff55, 0 5px 0 #4a2f99, 0 14px 26px #3a206e2b; }
body .olymp-promo-cta { border-radius: 14px; background: var(--oly-sun); color: var(--oly-ink); font-weight: 900; box-shadow: inset 0 2px 0 #ffffff77, 0 4px 0 #d99a12; }
body .olymp-promo-title { font-weight: 900; text-shadow: 0 2px 0 #3d6fc455; }
body .rails-teacher-shell .dashboard-content section, body .rails-teacher-shell .dashboard-content article { border-radius: 22px; }

/* ---------- кабинет ученика и родителя ---------- */
body .student-header .header-learning { border: 0; border-radius: 16px; background: #f4f0ff; box-shadow: 0 3px 0 #d9cdf3; }
.oly-home { display: grid; gap: 26px; padding: 22px 0 64px; }
.oly-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; }
.oly-tabs::-webkit-scrollbar { display: none; }
.oly-tab { flex: 0 0 auto; display: grid; gap: 1px; padding: 10px 18px 12px; border-radius: 16px; text-decoration: none; line-height: 1.2; color: #5d7f97; background: #ffffffb8; box-shadow: 0 3px 0 #cfe2ee; }
.oly-tab b { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 900; white-space: nowrap; }
.oly-tab span { font-size: 13px; font-weight: 800; color: #86a3b9; white-space: nowrap; }
.oly-tab i { font-style: normal; font-size: 10.5px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; line-height: 1; padding: 4px 6px; border-radius: 6px; background: #e3eff8; color: #4c7a99; }
.oly-tab.is-active { color: #fff; background: linear-gradient(180deg, #8d6cf0, #6744d4); box-shadow: inset 0 2px 0 #ffffff55, 0 4px 0 var(--oly-purple-dark); }
.oly-tab.is-active span { color: #e9e2ff; }
.oly-tab.is-soon { cursor: default; }
.oly-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; gap: 12px; min-height: 380px; padding: 40px 44px; border-radius: 32px;
  background: linear-gradient(180deg, #62c2f5 0%, #8fd4fa 55%, #c6ecff 100%); box-shadow: inset 0 2px 0 #ffffff66, 0 6px 0 #4aa3d8, 0 18px 30px #1f6a9a2e; }
.oly-hero h1 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.08; color: #fff; text-shadow: 0 3px 0 #3d8fc4, 0 8px 20px #1c5f8d55; }
.oly-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.oly-chip { padding: 6px 14px 7px; border-radius: 999px; font-size: 14px; font-weight: 800; background: #ffffffd9; color: #1d4c6e; box-shadow: 0 3px 0 #9fc9e6; }
.oly-chip--sun { background: var(--oly-sun); color: var(--oly-ink); box-shadow: 0 3px 0 #d99a12; }
.oly-hero-lead { margin: 16px 0 24px; max-width: 520px; font-size: 18px; font-weight: 700; color: #10405f; }
.oly-hero-art { justify-self: center; width: min(330px, 100%); height: auto; margin: -30px 0 -60px; filter: drop-shadow(0 24px 24px #2f7fb544); }
.oly-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.oly-fact, .oly-soon { border: 1px solid #fff9ee; border-radius: 24px; background: linear-gradient(165deg, #fffcf6, #f3ebf3); box-shadow: inset 0 2px 3px #ffffffc4, 0 5px 0 var(--oly-ledge), 0 14px 26px #39245220; }
.oly-fact { display: flex; align-items: center; gap: 14px; padding: 16px 20px 18px; }
.oly-fact img { width: 76px; height: 72px; object-fit: contain; flex: none; }
.oly-fact b { display: block; font-size: 22px; font-weight: 900; line-height: 1.15; }
.oly-fact span { color: var(--oly-ink-2); font-size: 15px; }
.oly-next h2 { font-size: 28px; margin-bottom: 16px; }
.oly-next-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.oly-soon { display: block; padding: 20px 22px 24px; text-decoration: none; color: inherit; }
.oly-soon h3 { margin: 12px 0 6px; font-size: 22px; }
.oly-soon p { color: var(--oly-ink-2); font-size: 15px; }
.oly-soon-tag { display: inline-block; padding: 4px 10px 5px; border-radius: 8px; font-size: 12px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: #fff; background: var(--oly-coral); box-shadow: 0 2px 0 #c95a34; }
.oly-soon-tag--teal { background: var(--oly-teal); box-shadow: 0 2px 0 #138a88; }
a.oly-soon:hover { transform: translateY(-2px); }
@media (max-width: 900px) {
  .oly-hero { grid-template-columns: 1fr; padding: 28px 22px 0; min-height: 0; }
  .oly-hero-art { width: min(240px, 70%); margin: -10px auto -40px; }
  .oly-facts, .oly-next-grid { grid-template-columns: 1fr; }
  .oly-btn { width: 100%; }
}

/* ---------- страница олимпиады ---------- */
body .round-start-subtitle span, body .pill { background: #ece4ff; color: var(--oly-purple-dark); font-weight: 800; }
body .timer span { border-radius: 16px; font-weight: 900; }

/* ---------- уточнения: кнопки платформы заданы с !important, перекрываем так же ---------- */
body .btn:not(.btn-secondary):not(.btn-quiet), body input.btn:not(.btn-secondary):not(.btn-quiet) {
  background: linear-gradient(180deg, #8d6cf0, #6744d4) !important; border: 0 !important; border-radius: 16px;
  box-shadow: inset 0 2px 0 #ffffff55, inset 0 -3px 0 #00000018, 0 4px 0 var(--oly-purple-dark), 0 8px 14px #3a206e2b !important;
}
body .btn:not(.btn-secondary):not(.btn-quiet):active:not(:disabled) { box-shadow: inset 0 2px 0 #ffffff55, 0 1px 0 var(--oly-purple-dark), 0 3px 6px #3a206e2b !important; }
body .btn:disabled, body .pf-save:disabled { filter: grayscale(.5); opacity: .55; }
body .btn { margin-bottom: 4px; }

/* ссылки-действия были синими */
body .family-access-link, body .forgot-link, body .text-link, body .link-button { color: var(--oly-purple); font-weight: 800; }

/* карточки кабинета родителя и общие блоки */
body .family-parent-card, body .family-child-card, body .child-selection-tile, body .round-start-facts li,
body .results-summary, body .results-tasks .result-task-card, body .results-award, body .round-task-row, body .round-list-top, body .round-list-bottom {
  border: 1px solid #fff9ee; border-radius: 22px; background: linear-gradient(165deg, #fffdf8, #f8f1f7);
  box-shadow: inset 0 2px 3px #ffffffc4, 0 4px 0 var(--oly-ledge), 0 12px 22px #3924521c;
}
body .round-start-facts li { padding: 8px 14px; border-radius: 14px; box-shadow: 0 3px 0 var(--oly-ledge); }
body .avatar.peach, body .family-child-card .avatar { background: #ece4ff; color: var(--oly-purple); font-weight: 900; }
body .cabinet-error, body .error-box { border-radius: 14px; background: #ffe9e4; color: #a12b12; font-weight: 800; }
body .cabinet-notice { border-radius: 14px; background: #e3f7ee; color: #14694a; font-weight: 800; }
body .round-start .start-intro { padding: 30px 28px 34px; background: linear-gradient(165deg, #fffdf8, #f8f1f7); }
body .round-start .start-intro .cabinet-error { margin-top: 18px; }

/* ---------- центр помощи ---------- */
body.help-page, body.help-page input, body.help-page button, body.help-page textarea, body.help-page select { font-family: var(--oly-font); }
body.help-page { color: var(--oly-ink); font-weight: 600; --h-accent: #6744d4; --h-accent-hover: #4a2f99; --h-ink: #2b1d3f; --h-text: #3d3050; --h-soft: #ece4ff; }
body.help-page h1, body.help-page h2, body.help-page h3 { font-weight: 900; color: var(--oly-ink); }
body.help-page .help-header { background: #fffffff2; border-bottom: 1px solid #cfe5f4; box-shadow: 0 10px 26px #1f6a9a1f; }
body.help-page .help-hero { background: transparent; }
body.help-page .help-tile, body.help-page .help-article-link, body.help-page .help-article, body.help-page .help-form, body.help-page .help-panel {
  border: 1px solid #fff9ee; border-radius: 22px; background: linear-gradient(165deg, #fffdf8, #f8f1f7);
  box-shadow: inset 0 2px 3px #ffffffc4, 0 4px 0 var(--oly-ledge), 0 12px 22px #3924521c;
}
body.help-page .help-tile.is-parent { background: linear-gradient(165deg, #f4fffb, #e6f6f1); }
body.help-page .help-tile.is-teacher { background: linear-gradient(165deg, #faf6ff, #efe7fb); }
body.help-page .help-footer { border-top-color: #eadff0; }
body.help-page input, body.help-page textarea, body.help-page select { border: 2px solid #e1d4ec; border-radius: 14px; font-weight: 700; }

/* ---------- кабинет ученика: ширина как у шапки ---------- */
.oly-home.wrap { width: min(1200px, calc(100% - 64px)); }
@media (max-width: 700px) { .oly-home.wrap { width: calc(100% - 32px); } }

/* внутри окон формы не выглядят отдельной карточкой */
body dialog .registration-card, body turbo-frame#modal .registration-card, body dialog form, body .modal-card .registration-card { border: 0; box-shadow: none; background: transparent; }
body dialog, body .modal-card, body .action-dialog { border-radius: 26px; }

/* простая шапка служебных страниц — без плашки, подпись логотипа в две строки */
body .simple-header { background: transparent; border-bottom: 0; box-shadow: none; }
body .brand .brand-description { white-space: nowrap; }

/* ---------- список заданий тура ---------- */
body .round-task-list, body .round-task-list strong, body .round-task-list span { font-family: var(--oly-font); }
body .round-list-top, body .round-list-bottom { border: 0; background: transparent; box-shadow: none; border-radius: 0; }
body .round-task-row { border: 1px solid #fff9ee; color: var(--oly-ink); }
body .round-task-row > strong { font: 900 clamp(20px, 2.4vw, 24px)/1.25 var(--oly-font); }
body .round-task-row:hover { background: linear-gradient(165deg, #fff, #f3ecfb); border-color: #fff9ee; transform: translateY(-1px); }
body .round-task-number { background: linear-gradient(180deg, #8d6cf0, #6744d4); box-shadow: 0 3px 0 var(--oly-purple-dark); font-weight: 900; }
body .round-list-clock strong { font-weight: 900; color: var(--oly-ink); }
body .olympiad-finished-rules { border: 0; border-radius: 22px; background: #ffffffb8; box-shadow: 0 4px 0 #dfe9ef; }
