@font-face { font-family: "PT Serif"; font-weight: 400; font-display: swap; src: url(fonts/pt-serif-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0400-04FF; }
@font-face { font-family: "PT Serif"; font-weight: 700; font-display: swap; src: url(fonts/pt-serif-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0400-04FF; }
@font-face { font-family: "PT Serif"; font-weight: 400; font-display: swap; src: url(fonts/pt-serif-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "PT Serif"; font-weight: 700; font-display: swap; src: url(fonts/pt-serif-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "PT Sans"; font-weight: 400; font-display: swap; src: url(fonts/pt-sans-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0400-04FF; }
@font-face { font-family: "PT Sans"; font-weight: 700; font-display: swap; src: url(fonts/pt-sans-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0400-04FF; }
@font-face { font-family: "PT Sans"; font-weight: 400; font-display: swap; src: url(fonts/pt-sans-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "PT Sans"; font-weight: 700; font-display: swap; src: url(fonts/pt-sans-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --navy: #1F3A68;
  --navy-light: #2F5292;
  --page: #E9EDF2;
  --white: #FFFFFF;
  --text: #1C1F24;
  --muted: #5A6472;
  --border: #C4CCD8;
  --head: #E9EEF5;
  --zebra: #F7F9FB;
  --link: #1F4E9A;
  --present: #2B7A3D;
  --late: #A8620A;
  --absent: #A61B1B;
  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --sans: "PT Sans", Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; }
body { font-family: var(--sans); font-size: 17px; line-height: 1.5; color: var(--text); background: var(--page); }
a { color: var(--link); }
h1, h2 { font-family: var(--serif); color: var(--navy); font-weight: 700; }
h1 { font-size: 28px; line-height: 1.25; padding-bottom: 10px; border-bottom: 2px solid var(--navy); margin-bottom: 20px; }
h2 { font-size: 19px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* Шапка */
.site { max-width: 1040px; margin: 0 auto; background: var(--white); min-height: 100vh; display: flex; flex-direction: column; box-shadow: 0 0 0 1px var(--border); }
.masthead { padding: 22px 28px 18px; border-bottom: 1px solid var(--border); }
.masthead .college { font-family: var(--serif); color: var(--muted); font-size: 15px; }
.masthead .title { font-family: var(--serif); font-weight: 700; font-size: 26px; color: var(--navy); text-decoration: none; display: inline-block; margin-top: 2px; }
.menu { background: var(--navy); display: flex; flex-wrap: wrap; align-items: stretch; }
.menu a, .menu span { color: #fff; text-decoration: none; padding: 11px 20px; font-size: 16px; }
.menu a:hover { background: var(--navy-light); }
.menu a[aria-current="page"] { background: var(--navy-light); font-weight: 700; }
.menu .who { margin-left: auto; opacity: .85; }

main { padding: 28px; flex: 1; }
.narrow { max-width: 460px; }
.stack > * + * { margin-top: 26px; }
footer { border-top: 1px solid var(--border); padding: 16px 28px; font-size: 14px; color: var(--muted); background: var(--zebra); }

/* Блоки с заголовком */
.box { border: 1px solid var(--border); background: var(--white); }
.box > h2 { background: var(--head); border-bottom: 1px solid var(--border); padding: 9px 16px; font-size: 18px; }
.box > .body { padding: 18px 16px; }

/* Формы */
label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 5px; }
.field + .field { margin-top: 14px; }
input, select { width: 100%; font: inherit; font-size: 16px; padding: 9px 10px; border: 1px solid #9EA9B8; border-radius: 3px; background: #fff; color: var(--text); }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid #9CB6E0; outline-offset: 1px; }
.row { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; }
.row > .field { flex: 1 1 200px; margin: 0; }
button, .btn { font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; border: 1px solid var(--navy); border-radius: 3px; padding: 9px 18px; background: var(--navy); color: #fff; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: var(--navy-light); border-color: var(--navy-light); }
button.secondary, .btn.secondary { background: #fff; color: var(--navy); }
button.secondary:hover, .btn.secondary:hover { background: var(--head); }
button.full { width: 100%; margin-top: 18px; padding: 11px; }
.link-btn { background: none; border: 0; color: var(--link); padding: 0; font-weight: 400; text-decoration: underline; font-size: 15px; }
.link-btn:hover { background: none; }

/* Сообщения */
.note { border: 1px solid var(--border); border-left: 5px solid var(--navy); background: var(--zebra); padding: 12px 16px; }
.note.ok { border-left-color: var(--present); }
.note.warn { border-left-color: var(--late); background: #FFF8EC; }
.note.bad { border-left-color: var(--absent); background: #FDF1F1; }
.note p + p { margin-top: 4px; }
.error { border: 1px solid #E3B4B4; background: #FDF1F1; color: var(--absent); padding: 9px 12px; margin-bottom: 14px; font-size: 15px; }
.hint { font-size: 15px; color: var(--muted); margin-top: 14px; }

/* Статусы */
.st { font-weight: 700; }
.st-present { color: var(--present); }
.st-late { color: var(--late); }
.st-absent { color: var(--absent); }

/* Таблицы */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 16px; background: var(--white); }
th, td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; }
thead th { background: var(--head); font-weight: 700; color: var(--navy); }
tbody tr:nth-child(even) td { background: var(--zebra); }
td.c, th.c { text-align: center; white-space: nowrap; }
td.c-present { color: var(--present); font-weight: 700; text-align: center; }
td.c-late { color: var(--late); font-weight: 700; text-align: center; }
td.c-absent { color: var(--absent); font-weight: 700; text-align: center; }
tr.warn td:first-child { color: var(--absent); font-weight: 700; }
.journal th:first-child, .journal td:first-child { position: sticky; left: 0; background: inherit; min-width: 180px; }
.journal tbody td:first-child { background: var(--white); }
.journal tbody tr:nth-child(even) td:first-child { background: var(--zebra); }

/* Страница студента */
.percent { font-family: var(--serif); font-size: 56px; font-weight: 700; color: var(--navy); line-height: 1; }

/* Результат отметки */
.result { text-align: center; padding: 34px 20px; border: 1px solid var(--border); }
.result .mark { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; font-size: 38px; color: #fff; }
.result.ok .mark { background: var(--present); }
.result.fail .mark { background: var(--absent); }
.result h1 { border: 0; padding: 0; margin: 0; }
.result p { margin-top: 10px; color: var(--muted); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .masthead { padding: 16px 16px 12px; }
  .masthead .title { font-size: 21px; }
  .masthead .college { font-size: 13px; }
  .menu a, .menu span { padding: 10px 12px; font-size: 15px; }
  .menu .who { display: none; }
  .menu a[href="/logout"] { margin-left: auto; }
  main { padding: 20px 16px; }
  h1 { font-size: 23px; }
  footer { padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Камера и проверка лица */
.cam { position: relative; width: 100%; max-width: 360px; aspect-ratio: 3 / 4; margin: 0 auto; background: #1C1F24; border: 1px solid var(--border); overflow: hidden; }
.cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.cam .oval { position: absolute; inset: 12% 18% 18%; border: 3px dashed rgba(255,255,255,.75); border-radius: 50%; transition: border-color .2s; }
.cam.found .oval { border-style: solid; border-color: #7BD389; }
.cam-msg { text-align: center; font-size: 19px; font-weight: 700; color: var(--navy); margin-top: 14px; min-height: 29px; }
.cam-sub { text-align: center; color: var(--muted); font-size: 15px; margin-top: 2px; min-height: 22px; }
.steps { list-style: none; padding: 0; display: flex; justify-content: center; gap: 18px; margin-top: 14px; font-size: 15px; }
.steps li { color: var(--muted); }
.steps li::before { content: "○ "; }
.steps li.done { color: var(--present); font-weight: 700; }
.steps li.done::before { content: "✓ "; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 15px; }
.consent input { width: auto; margin-top: 4px; }
.thumb { width: 44px; height: 44px; object-fit: cover; border: 1px solid var(--border); vertical-align: middle; }
