:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #002b60;
  --muted: #6b7280;
  --line: #e2e5ea;
  --dark: #002b60;
  --dark-hover: #001d42;
  --radius: 12px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; }

.page { width: 100%; max-width: 860px; padding: 48px 20px; text-align: center; }

.logo-link { display: inline-block; margin-bottom: 40px; }
.logo { display: block; width: 320px; max-width: 80vw; max-height: 160px; height: auto; object-fit: contain; }

.menu { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }

.btn {
  display: flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink);
  font-size: 1rem; font-weight: 600; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: #c9ced6; background: #fafbfc; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid #9bb7ff; outline-offset: 2px; }

/* the main call to action: the training site */
.btn.primary { background: var(--dark); border-color: var(--dark); color: #fff; }
.btn.primary:hover { background: var(--dark-hover); border-color: var(--dark-hover); }

/* placeholder pages */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 40px 24px; margin: 0 0 24px; }
.card h1 { margin: 0 0 8px; font-size: 1.7rem; line-height: 1.2; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--muted); }
.back { display: inline-flex; width: auto; padding-left: 24px; padding-right: 24px; }

@media (max-width: 720px) { .menu { grid-template-columns: repeat(2, 1fr); }
  .menu .btn:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (max-width: 380px) { .menu { grid-template-columns: 1fr; } }

/* "О Компании": presentation viewers */
[hidden] { display: none !important; }
.page.wide { max-width: 1040px; }
.page.wide .logo { width: 200px; }
.page.wide .logo-link { margin-bottom: 28px; }
.page-title { margin: 0 0 24px; font-size: 1.9rem; line-height: 1.2; letter-spacing: -.01em; }

.deck { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin: 0 0 24px; text-align: left; }
.deck h2 { margin: 0 0 14px; font-size: 1.25rem; line-height: 1.3; }
.stage { position: relative; aspect-ratio: 16 / 9; background: #eef0f4; border-radius: 12px; overflow: hidden; touch-action: pan-y; }
.stage:focus-visible { outline: 3px solid #9bb7ff; outline-offset: 2px; }
.stage:fullscreen { background: #000; border-radius: 0; }
.slide { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(0, 43, 96, .85); color: #fff; font-size: 28px; line-height: 1;
  display: grid; place-items: center; padding: 0 0 4px; cursor: pointer;
}
.nav:hover { background: var(--dark); }
.nav:disabled { visibility: hidden; }
.nav.prev { left: 12px; }
.nav.next { right: 12px; }
.deck-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; color: var(--muted); font-size: .95rem; }
.deck-bar .spacer { flex: 1; }
.deck-bar button {
  color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 14px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.deck-bar button:hover { border-color: #c9ced6; background: #fafbfc; }
@media (max-width: 640px) { .deck { padding: 14px; } .nav { width: 38px; height: 38px; font-size: 24px; } }

/* "Реквизиты": company details card */
.doc-card { max-width: 760px; margin: 0 auto 24px; text-align: left; padding: 28px; }
.doc-card h2 { margin: 0 0 12px; font-size: 1.35rem; line-height: 1.3; }
.reqs { margin: 0; display: grid; grid-template-columns: minmax(150px, 240px) 1fr; }
.reqs dt, .reqs dd { margin: 0; padding: 12px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.reqs dt { color: var(--muted); font-weight: 600; padding-right: 16px; }
.reqs dd { font-weight: 500; }
.reqs dd a { color: var(--dark); }
@media (max-width: 560px) {
  .doc-card { padding: 20px; }
  .reqs { grid-template-columns: 1fr; }
  .reqs dt { padding: 12px 0 0; }
  .reqs dd { border-top: 0; padding-top: 2px; }
}

/* "Закон": lists of legal documents */
.law-list { margin: 8px 0 0; padding-left: 1.5em; }
.law-list li { margin: 0; padding: 10px 0 10px 4px; border-top: 1px solid var(--line); }
.law-list li:first-child { border-top: 0; }
.law-list li::marker { color: var(--muted); font-weight: 600; }

/* "Обучение": three wide stacked buttons */
.menu.stack { grid-template-columns: 1fr; max-width: 640px; margin: 0 auto 28px; }
.menu.stack .btn { min-height: 68px; padding: 16px 24px; line-height: 1.35; text-align: center; }
.page-title { text-wrap: balance; }

/* buttons that do not open anything yet */
button.btn { font-family: inherit; line-height: 1.35; }

/* sections that open to show their topics (electrical safety page) */
details.section > summary.btn { position: relative; padding-right: 52px; padding-left: 52px; list-style: none; cursor: pointer; }
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary::after {
  content: ""; position: absolute; right: 22px; top: 50%; width: 9px; height: 9px; margin-top: -7px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
  transition: transform .15s;
}
details.section[open] > summary::after { transform: rotate(-135deg); margin-top: -2px; }
details.section[open] > summary.btn { border-color: #c9ced6; }
.topics { display: grid; gap: 8px; margin: 8px 0 6px 28px; }
.menu.stack .btn.sub { min-height: 52px; padding: 12px 18px; font-size: .95rem; font-weight: 500; background: #f8f9fb; text-align: left; justify-content: flex-start; }
.menu.stack .btn.sub:hover { background: #fff; }
@media (max-width: 560px) { .topics { margin-left: 12px; } details.section > summary.btn { padding-left: 40px; padding-right: 44px; } details.section > summary::after { right: 16px; } }

/* attestation tracker: a row per person, a column per lesson */
.page.xwide { max-width: 1400px; }
.att-scroll { overflow-x: auto; max-width: 100%; box-sizing: border-box; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
table.att { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.att th, .att td { padding: 8px 6px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); text-align: center; vertical-align: middle; background: #fff; }
.att thead th { background: #f8f9fb; font-size: .8rem; font-weight: 600; color: var(--ink); }
.att th.grp { font-size: .78rem; line-height: 1.3; padding: 10px 12px; min-width: 120px; }
.att th.num { min-width: 40px; cursor: help; }
.att .att-name { position: sticky; left: 0; z-index: 2; text-align: left; min-width: 170px; max-width: 200px; padding: 10px 14px; border-left: 0; box-shadow: 1px 0 0 var(--line); background: #fff; }
.att thead .att-name { background: #f8f9fb; z-index: 3; }
.att .att-total { min-width: 70px; font-size: .8rem; color: var(--muted); }
.att tbody tr:last-child td { border-bottom: 0; }
.att-login { display: block; font-size: .8rem; color: var(--muted); font-weight: 400; }
.att tr.off td { opacity: .55; }
.att-cell form { margin: 0; }
.res { display: block; width: 100%; min-width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 1rem; font-weight: 700; line-height: 1; cursor: pointer; padding: 0; }
.res.none { border-style: dashed; }
.res.none:hover { background: #f4f5f7; }
.res.pass, .key.pass { background: #e3f4e6; border-color: #9bd3a6; color: #1c6b2d; }
.res.fail, .key.fail { background: #fde6e6; border-color: #eba3a3; color: #a32121; }
.key { display: inline-block; padding: 1px 8px; border-radius: 8px; border: 1px solid; font-weight: 600; }
.att-note { color: var(--muted); font-size: .88rem; line-height: 1.6; margin: 0 0 22px; }
.att-legend { text-align: left; margin: 0 0 24px; display: grid; gap: 8px; }
.att-legend details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.att-legend summary { cursor: pointer; font-weight: 600; color: var(--ink); font-size: .92rem; }
.att-legend ol { margin: 10px 0 2px; padding-left: 26px; font-size: .88rem; line-height: 1.55; color: #1f2937; }
.att-legend ul { margin: 2px 0 6px; padding-left: 18px; color: var(--muted); }

/* "Отзывы": letters of thanks, one per screen */
.letters { display: grid; gap: 36px; justify-items: center; margin: 0 0 32px; }
.letter { margin: 0; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.letter img { display: block; width: min(100%, calc(86vh * 0.71)); height: auto; aspect-ratio: 1061 / 1500; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 6px 22px rgba(0, 43, 96, .12); }
.letter figcaption { color: var(--muted); font-size: .85rem; }

/* "Контакты" */
.contacts { display: grid; grid-template-columns: 1.5fr 1.1fr 1fr; gap: 28px; text-align: left; padding: 32px 36px; }
.contacts h2 { margin: 0 0 8px; font-size: 1rem; }
.contacts p { margin: 0; color: #4b5563; line-height: 1.7; }
.contacts a { color: var(--dark); text-decoration: none; border-bottom: 1px solid #b9c4d6; }
.contacts a:hover { border-bottom-color: var(--dark); }
@media (max-width: 640px) { .contacts { grid-template-columns: 1fr; gap: 20px; padding: 22px; } }

/* "Календарный учебный график": a button per training direction that opens its table */
.sched-list { display: grid; gap: 12px; margin: 0 0 28px; }
details.sched > summary.btn { max-width: 640px; margin: 0 auto; min-height: 68px; padding-top: 16px; padding-bottom: 16px; line-height: 1.35; text-align: center; justify-content: center; }
.sched-scroll { overflow-x: auto; margin: 12px 0 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
table.sched-table { width: 100%; min-width: 820px; border-collapse: collapse; font-size: .88rem; text-align: left; }
.sched-table th, .sched-table td { border: 1px solid var(--line); padding: 8px 8px; vertical-align: middle; }
.sched-table thead th { background: #f8f9fb; color: var(--ink); font-weight: 700; text-align: center; }
.sched-table .c-n { width: 44px; text-align: center; }
.sched-table .c-title { min-width: 300px; }
.sched-table thead .c-title { text-align: left; }
.sched-table .c-day { width: 46px; text-align: center; }
.sched-table .c-total { width: 62px; text-align: center; font-weight: 700; }
.sched-table tfoot td { background: #f8f9fb; font-weight: 700; }
.sched-table tbody tr:hover td { background: #fafbfd; }
.sched-table thead tr:first-child th, .sched-table tfoot td { border-color: #cfd5de; }
.sched-list { grid-template-columns: minmax(0, 1fr); }
.sched-list details { min-width: 0; }

/* the three schedule tables one under another, each about one screen tall */
.sched-list { gap: 0; }
.sched-block { min-height: 92vh; display: flex; flex-direction: column; justify-content: flex-start; padding: 8px 0 40px; }
.sched-title { margin: 0 auto 16px; max-width: 760px; font-size: 1.15rem; line-height: 1.35; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 24px; }
.sched-block .sched-scroll { margin-top: 0; }
@media (max-width: 560px) { .sched-block { min-height: 0; padding-bottom: 28px; } .sched-title { font-size: 1rem; padding: 14px 16px; } }

/* tighter gap between the tables: the next table's heading shows up right below the one being read */
.sched-block { min-height: 0; padding: 0 0 22px; }
.sched-title { margin-bottom: 12px; padding: 12px 22px; font-size: 1.05rem; }
@media (max-width: 560px) { .sched-block { padding-bottom: 18px; } .sched-title { padding: 12px 14px; font-size: .95rem; } }

/* read-only marks (guests) look like the buttons but do nothing */
span.res { cursor: default; display: flex; align-items: center; justify-content: center; }

/* signed-in bar and login link on the public pages */
.util { position: absolute; top: 10px; right: 14px; display: flex; gap: 14px; align-items: center; font-size: .82rem; color: var(--muted); }
.util a { color: var(--muted); text-decoration: none; }
.util a:hover { color: var(--ink); text-decoration: underline; }
.util form { margin: 0; }
.util button { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; }
.util button:hover { color: var(--ink); text-decoration: underline; }
.foot { margin: 36px 0 0; font-size: .8rem; }
.foot a { color: #9aa3b2; text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }

/* attestation: search, pager, fail counter */
.att-search { display: flex; gap: 8px; justify-content: center; margin: 0 0 16px; flex-wrap: wrap; }
.att-search input { flex: 1; min-width: 200px; max-width: 360px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
.att-search .btn { min-height: 0; padding: 9px 16px; }
.pager { display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; margin: 0 0 18px; color: var(--muted); font-size: .88rem; }
.pager .btn { min-height: 0; padding: 8px 16px; }
.n-fail-txt { color: #a32121; }
button.res:disabled { opacity: .6; cursor: wait; }
