/* Klientská zóna Kompatiqo. Tokens, base, header and footer follow the kompatiqo.cz theme
   (wp-content/themes/kompatiqo/assets/css/main.css); portal components follow its button and form language.
   No inline styles anywhere: the CSP allows style-src 'self' only. */

@font-face {
	font-family: "Inter";
	src: url("../fonts/inter.woff2") format("woff2");
	font-weight: 400 650;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Inter Tight";
	src: url("../fonts/inter-tight.woff2") format("woff2");
	font-weight: 500 700;
	font-style: normal;
	font-display: swap;
}

:root {
	--papir: #FAFAF9;
	--papir-2: #F1F1EE;
	--inkoust: #15171C;
	--grafit: #5A5F69;
	--linka: #E2E2DE;
	--signal: #1F4FD8;
	--signal-tmavy: #173DB0;
	--chyba: #B42318;

	--font-text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-display: "Inter Tight", "Inter", system-ui, sans-serif;
	--font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

	--step--1: 0.875rem;
	--step-0: 1.0625rem;
	--step-1: 1.25rem;
	--step-2: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
	--step-3: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
	--step-4: clamp(2.25rem, 1.4rem + 3.4vw, 4rem);

	--gutter: clamp(1rem, 4vw, 2.5rem);
	--radius: 10px;
	--measure: 68ch;
}

/* Base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--papir);
	color: var(--inkoust);
	font: 400 var(--step-0)/1.6 var(--font-text);
	font-feature-settings: "cv11", "ss03";
	-webkit-font-smoothing: antialiased;
}
main { flex: 1; }
main:focus { outline: none; }
h1, h2, h3 {
	margin: 0;
	font-family: var(--font-display);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.015em;
	text-wrap: balance;
}
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: var(--signal); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--signal-tmavy); }
code { font-family: var(--font-mono); font-size: 0.9em; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: 0.6rem 1rem; background: var(--inkoust); color: #fff; border-radius: 6px; }
.skip:focus { top: 1rem; color: #fff; }

/* Layout */

.wrap { width: 100%; max-width: calc(76rem + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: calc(34rem + 2 * var(--gutter)); }
.page { padding-block: clamp(2rem, 1.5rem + 3vw, 4rem); }
.page-head { margin-bottom: 2rem; }
.page-head__title { font-size: var(--step-3); letter-spacing: -0.025em; margin-bottom: 0.75rem; }
.page-head__lead { max-width: 40rem; color: var(--grafit); font-size: var(--step-1); line-height: 1.5; }
.section-title { font-size: var(--step-2); margin: 2.5rem 0 1rem; }

/* Header */

.site-header { position: sticky; top: 0; z-index: 50; background: rgb(250 250 249 / 0.92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--linka); }
.site-header__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; min-height: 4.25rem; padding-block: 0.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--inkoust); text-decoration: none; }
.brand:hover { color: var(--inkoust); }
.brand__mark { width: 1.9rem; height: 1.9rem; }
.brand__dot { fill: var(--signal); }
.brand__name { font: 700 1.125rem/1 var(--font-display); letter-spacing: 0.08em; }
.brand__area { padding-left: 0.6rem; border-left: 1px solid var(--linka); color: var(--grafit); font-size: var(--step--1); font-weight: 500; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.75rem; }
.site-nav__list { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; margin: 0; padding: 0; list-style: none; }
.site-nav__list a { color: var(--inkoust); font-weight: 500; font-size: 0.975rem; text-decoration: none; padding-block: 0.4rem; border-bottom: 1.5px solid transparent; }
.site-nav__list a:hover { color: var(--signal); }
.site-nav__list a[aria-current="page"] { border-bottom-color: var(--signal); }
.site-nav form { margin: 0; }
.site-nav__who { color: var(--grafit); font-size: var(--step--1); }
.staff-nav { border-bottom: 1px solid var(--linka); background: var(--papir-2); }
/* .site-nav__list resets margin to 0, which would cancel .wrap's centring on this list. */
.staff-nav .site-nav__list { flex-wrap: nowrap; overflow-x: auto; margin-inline: auto; padding-block: 0.6rem; }
.staff-nav .site-nav__list a { white-space: nowrap; }

/* Buttons */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 3rem; padding: 0.7rem 1.35rem; border: 1px solid var(--signal); border-radius: 8px; background: var(--signal); color: #fff; font: 600 var(--step-0)/1.2 var(--font-text); text-decoration: none; cursor: pointer; transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
.btn:hover { background: var(--signal-tmavy); border-color: var(--signal-tmavy); color: #fff; }
.btn--small { min-height: 2.75rem; padding: 0.5rem 1rem; font-size: var(--step--1); }
.btn--ghost { background: transparent; color: var(--inkoust); border-color: var(--inkoust); }
.btn--ghost:hover { background: var(--inkoust); border-color: var(--inkoust); color: #fff; }
.btn--danger { background: transparent; color: var(--chyba); border-color: var(--chyba); }
.btn--danger:hover { background: var(--chyba); border-color: var(--chyba); color: #fff; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 1.5rem; }

/* Forms */

.form { display: grid; gap: 1.25rem; max-width: 30rem; }
.form--wide { max-width: 46rem; }
.field { display: grid; gap: 0.4rem; }
.field__label { font: 500 0.95rem/1.4 var(--font-text); }
.field__hint { color: var(--grafit); font-size: var(--step--1); }
.field__error { color: var(--chyba); font-size: var(--step--1); }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea {
	width: 100%; min-height: 3rem; padding: 0.7rem 0.9rem; border: 1px solid #C9CAC4; border-radius: 8px;
	background: #fff; color: var(--inkoust); font: 400 var(--step-0)/1.4 var(--font-text);
}
.field textarea { min-height: 6rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--signal); outline: 2px solid rgb(31 79 216 / 0.25); outline-offset: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; padding: 0; border: 0; }
.checks label { display: inline-flex; align-items: center; gap: 0.5rem; }
.checks input { width: 1.15rem; height: 1.15rem; accent-color: var(--signal); }

/* Notes */

.note { margin-bottom: 1.5rem; padding: 1rem 1.25rem; border-left: 3px solid var(--signal); background: #fff; border-radius: 0 var(--radius) var(--radius) 0; }
.note--error { border-left-color: var(--chyba); }
.note--quiet { border-left-color: var(--linka); background: transparent; color: var(--grafit); }

/* Licence facts: the same six fields and words as the teacher app */

.facts { margin: 0; border-bottom: 1px solid var(--linka); }
.facts div { display: grid; gap: 0.25rem 2rem; padding-block: 0.75rem; border-top: 1px solid var(--linka); }
.facts dt { color: var(--grafit); font-size: var(--step--1); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 640px) { .facts div { grid-template-columns: 12rem 1fr; } }

.state { display: inline-flex; align-items: center; min-height: 1.9rem; padding: 0.2rem 0.75rem; border: 1px solid var(--grafit); border-radius: 999px; color: var(--grafit); font-size: var(--step--1); font-weight: 500; white-space: nowrap; }
.state--aktivni { border-color: var(--signal); color: var(--signal); }
.state--pozastavena, .state--vyprsela, .state--offline { border-style: dashed; }
.state--zrusena, .state--neplatna { border-color: var(--chyba); color: var(--chyba); }

.licences { display: grid; gap: 2rem; }
.licence { padding: 1.5rem; border: 1px solid var(--linka); border-radius: var(--radius); background: #fff; }
.licence__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; margin-bottom: 0.5rem; }
.licence__title { font-size: var(--step-1); font-family: var(--font-mono); letter-spacing: 0; }
.licence__explain { color: var(--grafit); margin-bottom: 1rem; }
.licence details { margin-top: 1rem; }
.licence summary { cursor: pointer; font-weight: 500; color: var(--signal); }
.key { width: 100%; min-height: 6rem; margin-top: 0.75rem; padding: 0.75rem; border: 1px solid var(--linka); border-radius: 8px; background: var(--papir-2); font: 0.8rem/1.4 var(--font-mono); word-break: break-all; resize: vertical; }

/* Staff tables and overview */

.table-wrap { overflow-x: auto; border: 1px solid var(--linka); border-radius: var(--radius); background: #fff; }
.table, .prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td, .prose th, .prose td { padding: 0.65rem 0.8rem; border-top: 1px solid var(--linka); text-align: left; vertical-align: top; }
.table thead th, .prose thead th { border-top: 0; color: var(--grafit); font-size: var(--step--1); font-weight: 600; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat { padding: 1.25rem; border: 1px solid var(--linka); border-radius: var(--radius); background: #fff; }
.stat__value { display: block; font: 600 var(--step-3)/1.1 var(--font-display); }
.stat__label { color: var(--grafit); font-size: var(--step--1); }
.qr { width: 12rem; height: 12rem; border: 1px solid var(--linka); border-radius: 8px; background: #fff; }
.secret { font-family: var(--font-mono); letter-spacing: 0.08em; overflow-wrap: anywhere; }

/* Prose (privacy notice) */

.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: var(--step-2); margin-top: 2.25em; }
.prose ul { padding-left: 1.4em; }
.prose li + li { margin-top: 0.4em; }
.prose .table-wrap { max-width: none; }

/* Footer */

.site-footer { margin-top: 4rem; border-top: 1px solid var(--linka); padding-top: 3rem; font-size: 0.95rem; color: var(--grafit); }
.site-footer__grid { display: grid; gap: 2rem 3rem; padding-bottom: 2.5rem; }
@media (min-width: 900px) { .site-footer__grid { grid-template-columns: 2fr 1fr; } }
.site-footer__name, .site-footer__heading { margin-bottom: 0.75rem; color: var(--inkoust); font: 600 1rem/1.3 var(--font-display); }
.site-footer address { font-style: normal; line-height: 1.7; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.site-footer a { color: var(--grafit); text-decoration: none; }
.site-footer a:hover { color: var(--signal); text-decoration: underline; }
.site-footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; padding-block: 1.5rem 2rem; border-top: 1px solid var(--linka); font-size: var(--step--1); }

@media print {
	.site-header, .site-footer, .skip, .actions, .staff-nav { display: none !important; }
	body { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
