/* Zaliczenie KODA i KODAL — style */
:root {
  --ink: #14213D;
  --muted: #4A5672;
  --ground: #F4F6FA;
  --card: #FFFFFF;
  --line: #DCE2EB;
  --line-soft: #EEF1F6;
  --input: #C3CCDA;
  --blue: #1769B3;
  --blue-dark: #0F4F8A;
  --blue-soft: #E6F0FA;
  --red: #B81F2A;
  --red-dark: #8A1720;
  --red-soft: #FBEAEB;
  --gold: #F2A900;
  --gold-soft: #FFF4D6;
  --gold-ink: #6B4A00;
  --green: #2E8B57;
  --green-soft: #E7F5EC;
  --green-ink: #1E5C38;
  --accent: var(--blue);
  --accent-dark: var(--blue-dark);
  --accent-soft: var(--blue-soft);
  --display: 'Bricolage Grotesque', 'Segoe UI', sans-serif;
  --body: 'Source Sans 3', 'Segoe UI', Helvetica, Arial, sans-serif;
  --radius: 18px;
}
body.kurs-kodal { --accent: var(--red); --accent-dark: var(--red-dark); --accent-soft: var(--red-soft); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.45; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; }
h1 { font-size: clamp(30px, 4vw, 42px); font-weight: 800; }
h2 { font-size: 24px; font-weight: 700; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0; }
img { max-width: 100%; }
.ico { flex: none; vertical-align: middle; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.tiny { font-size: 14px; }
.strong { font-weight: 700; }
.center { text-align: center; }
.inline { display: inline; margin: 0; }
.page { padding: 36px 0 64px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Nagłówek */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.logo { height: 60px; width: auto; display: block; }
.header-note { color: var(--muted); font-size: 15px; }
.gold-line { height: 4px; background: var(--gold); }
.main-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.main-nav a { padding: 10px 14px; border-radius: 10px; color: var(--ink); font-weight: 600; text-decoration: none; }
.main-nav a:hover { background: var(--line-soft); color: var(--ink); }
.main-nav a.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav-sep { width: 1px; height: 28px; background: var(--line); margin: 0 8px; }
.nav-user { font-size: 15px; color: var(--muted); }
.link-btn { background: none; border: 0; padding: 10px 12px; font: inherit; font-weight: 600; font-size: 15px; color: var(--accent); cursor: pointer; text-decoration: underline; }
.link-btn.light { color: #C9D3E3; }

/* Stopka */
.site-footer { border-top: 1px solid var(--line); background: #fff; padding: 16px 0; font-size: 14px; color: var(--muted); }
.site-footer a { color: var(--muted); }

/* Karty, odznaki, przyciski */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card-dark { background: var(--ink); color: #fff; border-radius: 20px; padding: 32px; }
.card-dark .muted { color: #C9D3E3; }
.eyebrow { font-weight: 700; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.eyebrow.accent { color: var(--accent); }
.eyebrow.gold { color: var(--gold); }
.badge { display: inline-block; align-self: flex-start; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; padding: 4px 12px; border-radius: 999px; }
.badge.koda { background: var(--blue); }
.badge.kodal { background: var(--red); }
.pill { display: inline-block; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; background: var(--line-soft); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--green-soft); color: var(--green-ink); }
.pill.bad { background: var(--red-soft); color: var(--red-dark); }
.pill.warn { background: var(--gold-soft); color: var(--gold-ink); }
.pill.info { background: var(--blue-soft); color: var(--blue-dark); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 12px; border: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn-lg { min-height: 56px; font-size: 19px; padding: 0 28px; }
.btn-dark { background: var(--ink); }
.btn-dark:hover { background: #0B1426; }
.btn-ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.btn-ghost:hover { background: var(--line-soft); color: var(--ink); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: var(--red-dark); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Formularze */
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; }
.field input, .field select, .field textarea, input.inp, select.inp, textarea.inp {
  min-height: 48px; border: 1px solid var(--input); border-radius: 10px; padding: 0 14px; font: inherit; font-weight: 400; font-size: 17px; color: var(--ink); background: #fff; width: 100%; min-width: 0;
}
.field textarea, textarea.inp { padding: 10px 14px; min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(23, 105, 179, .35); outline-offset: 1px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

/* Komunikaty */
.flash { padding: 14px 18px; border-radius: 12px; font-size: 16px; border: 1px solid; }
.flash-ok { background: var(--green-soft); border-color: #B7DEC6; color: var(--green-ink); }
.flash-error { background: var(--red-soft); border-color: #F0C2C6; color: var(--red-dark); }
.flash-info { background: var(--blue-soft); border-color: #BFD6EE; color: var(--blue-dark); }
.flash-warn { background: var(--gold-soft); border-color: #F2D27A; color: var(--gold-ink); }
.flashes { display: flex; flex-direction: column; gap: 10px; }

/* Strona startowa */
.home { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; padding: 48px 0 64px; }
.home-intro { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.home-intro .lead { font-size: 19px; color: var(--muted); max-width: 520px; }
.course-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.course-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.course-card .t { font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.2; }
.facts { display: flex; flex-wrap: wrap; gap: 12px; }
.fact { flex: 1 1 140px; background: var(--gold-soft); border-radius: 12px; padding: 14px 16px; }
.fact b { display: block; font-family: var(--display); font-weight: 800; font-size: 28px; }
.fact span { font-size: 15px; color: var(--muted); }
.auth-box { flex: 1 1 400px; min-width: 0; max-width: 480px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 20px; box-shadow: 0 12px 32px rgba(20, 33, 61, .08); }
.tabs2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; background: #EEF1F6; padding: 4px; border-radius: 12px; }
.tabs2 button { min-height: 46px; border: 0; border-radius: 9px; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; background: transparent; color: var(--muted); padding: 0 8px; }
.tabs2 button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20, 33, 61, .15); }
.course-pick { display: flex; flex-direction: column; gap: 8px; border: 0; margin: 0; padding: 0; }
.course-pick legend { font-weight: 600; font-size: 15px; padding: 0; margin-bottom: 8px; }
.course-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); cursor: pointer; min-height: 60px; }
.course-opt input { width: 22px; height: 22px; flex: none; }
.course-opt .c1 { font-weight: 700; font-size: 16px; display: block; }
.course-opt.koda .c1 { color: var(--blue); }
.course-opt.kodal .c1 { color: var(--red); }
.course-opt.koda:has(input:checked) { background: var(--blue-soft); border-color: var(--blue); }
.course-opt.kodal:has(input:checked) { background: var(--red-soft); border-color: var(--red); }

/* Panel uczestnika */
.big-date { font-family: var(--display); font-weight: 800; font-size: clamp(28px, 4vw, 40px); line-height: 1.1; }
.countdown { display: flex; gap: 12px; flex-wrap: wrap; }
.countdown div { background: rgba(255, 255, 255, .08); border-radius: 14px; padding: 12px 18px; min-width: 88px; }
.countdown b { display: block; font-family: var(--display); font-weight: 800; font-size: 34px; font-variant-numeric: tabular-nums; }
.countdown span { font-size: 14px; color: #C9D3E3; }
.score-big { display: flex; align-items: baseline; gap: 8px; }
.score-big b { font-family: var(--display); font-weight: 800; font-size: 64px; line-height: 1; }
.score-big span { font-size: 22px; color: var(--muted); }
.points-bar { position: relative; height: 14px; background: var(--line-soft); border-radius: 999px; }
.points-fill { height: 14px; background: var(--accent); border-radius: 999px; }
.points-mark { position: absolute; top: -6px; width: 3px; height: 26px; background: var(--ink); border-radius: 2px; margin-left: -1px; }
.points-scale { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-top: 6px; }
.points-scale .strong { color: var(--ink); }
.note { background: var(--gold-soft); border-radius: 12px; padding: 12px 14px; font-size: 16px; }
.segments { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.segments span { height: 12px; border-radius: 999px; background: #E3E8F0; }
.segments .seg-done { background: var(--accent); }
.segments .seg-today, .segments .seg-running { background: var(--gold); }
.segments .seg-missed { background: repeating-linear-gradient(45deg, #E3B4B8 0 6px, #F4D6D8 6px 12px); }
.sched-row { display: flex; align-items: center; gap: 16px; padding: 14px 4px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.sched-num { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; background: var(--line-soft); color: var(--muted); }
.sched-num.done { background: var(--accent); color: #fff; }
.sched-num.today, .sched-num.running, .sched-num.next { background: var(--gold); color: var(--ink); }
.sched-num.missed { background: var(--red-soft); color: var(--red-dark); }
.sched-main { flex: 1 1 260px; min-width: 0; }
.sched-main .t { font-weight: 700; }
.today-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--gold-soft); border: 1px solid #F2D27A; border-radius: 16px; padding: 16px 20px; color: var(--ink); }
.today-bar .left { display: flex; align-items: center; gap: 12px; }
.today-bar .left .ico { color: var(--gold-ink); }
.video { position: relative; aspect-ratio: 16 / 9; width: 100%; border-radius: 18px; overflow: hidden; background: #0E1628; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-missing { display: flex; align-items: center; justify-content: center; color: #C9D3E3; height: 100%; padding: 20px; text-align: center; }
.take-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.rules { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 16px; }
.main-col { flex: 3 1 560px; min-width: 0; }
.side-col { flex: 1 1 280px; min-width: 0; }

/* Okno potwierdzenia */
.modal { position: fixed; inset: 0; background: rgba(14, 22, 40, .6); display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; z-index: 50; }
.modal.is-open { display: flex; }
.modal-box { width: 100%; max-width: 520px; background: #fff; border-radius: 22px; padding: 32px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 24px 60px rgba(14, 22, 40, .35); }
.modal-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-ink); display: flex; align-items: center; justify-content: center; }
.modal-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

/* Test */
.test-head { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 10; }
.test-head .bar-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.timer { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; font-family: var(--display); font-weight: 800; font-size: 26px; font-variant-numeric: tabular-nums; background: rgba(255, 255, 255, .1); }
.timer.low { background: var(--gold); color: var(--ink); }
.time-track { height: 6px; background: #2A3A5E; }
.time-fill { height: 6px; background: var(--accent); width: 100%; transition: width 1s linear; }
.time-fill.low { background: var(--gold); }
.q-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; gap: 14px; border-width: 1px; margin: 0; }
.q-card legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; }
.q-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.q-text { font-size: 21px; font-weight: 700; line-height: 1.35; clear: both; }
.opt { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 14px; border-radius: 12px; border: 2px solid var(--line); cursor: pointer; font-size: 17px; background: #fff; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt .mark { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; background: var(--line-soft); color: var(--muted); }
.opt:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.opt:has(input:checked) .mark { background: var(--accent); color: #fff; }
.opt:has(input:focus-visible) { outline: 3px solid rgba(23, 105, 179, .35); }
.save-state { font-size: 14px; color: #C9D3E3; }

/* Wynik */
.result-hero { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 36px; }
.result-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); color: var(--green-ink); display: flex; align-items: center; justify-content: center; }
.result-score b { font-family: var(--display); font-weight: 800; font-size: 80px; line-height: 1; }
.result-score span { font-size: 26px; color: var(--muted); }
.chips { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* Materiały */
.file-row { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.file-row:last-child { border-bottom: 0; }
.file-badge { width: 56px; height: 56px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex: none; }
.file-badge.PDF { background: var(--red-soft); color: var(--red-dark); }
.file-badge.DOCX { background: var(--blue-soft); color: var(--blue-dark); }
.file-badge.PPTX { background: var(--gold-soft); color: var(--gold-ink); }
.file-main { flex: 1 1 240px; min-width: 0; }
.file-main .t { font-weight: 700; }
.syllabus { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.syllabus .left { display: flex; align-items: center; gap: 18px; }
.syllabus .ic { width: 60px; height: 60px; border-radius: 14px; background: var(--gold); color: var(--ink); display: flex; align-items: center; justify-content: center; flex: none; }
.btn-white { background: #fff; color: var(--ink); }
.btn-white:hover { background: var(--line-soft); color: var(--ink); }

/* Panel admina */
.admin-header { background: var(--ink); color: #fff; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.admin-brand { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-badge { background: var(--gold); color: var(--ink); font-weight: 800; font-size: 13px; letter-spacing: .08em; padding: 4px 10px; border-radius: 6px; }
.admin-title { font-family: var(--display); font-weight: 700; font-size: 20px; }
.admin-year { color: #C9D3E3; font-size: 15px; }
.admin-user { display: flex; align-items: center; gap: 12px; color: #C9D3E3; font-size: 15px; flex-wrap: wrap; }
.admin-user a { color: #C9D3E3; }
.admin-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-tabs a { padding: 12px 16px; color: #C9D3E3; font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; }
.admin-tabs a:hover { color: #fff; }
.admin-tabs a.is-active { color: #fff; font-weight: 700; border-bottom-color: var(--gold); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 4px; background: #E3E8F0; padding: 4px; border-radius: 12px; flex-wrap: wrap; }
.seg a { min-height: 42px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 9px; font-weight: 700; font-size: 15px; color: var(--muted); text-decoration: none; }
.seg a.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20, 33, 61, .15); }
.seg a.is-on.is-koda { background: var(--blue); color: #fff; }
.seg a.is-on.is-kodal { background: var(--red); color: #fff; }
.table-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 16px; }
.tbl th { text-align: left; background: #F7F9FC; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: center; }
.tbl .right { text-align: right; }
.sc { display: inline-block; min-width: 40px; text-align: center; font-weight: 700; border-radius: 8px; padding: 5px 0; background: var(--ground); }
.sc.missed { background: var(--red-soft); color: var(--red-dark); }
.sc.future { background: transparent; color: #9AA5B8; font-weight: 400; }
.sc.running { background: var(--gold-soft); color: var(--gold-ink); }
.sum { font-family: var(--display); font-weight: 800; font-size: 20px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.tile b { display: block; font-family: var(--display); font-weight: 800; font-size: 34px; }
.tile span { font-size: 15px; color: var(--muted); }
.actions-cell { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.icon-btn:hover { background: var(--line-soft); }
.icon-btn.danger { color: var(--red-dark); }
.sched-table input { min-height: 44px; font-size: 16px; }
.sched-table td:first-child { width: 56px; }
.n-dot { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: var(--accent); }
.test-list { display: flex; flex-direction: column; gap: 4px; }
.test-list a { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; border: 2px solid transparent; }
.test-list a:hover { background: var(--line-soft); }
.test-list a.is-on { background: var(--accent-soft); border-color: var(--accent); }
.test-list small { color: var(--muted); font-size: 14px; }
.q-edit { display: flex; flex-direction: column; gap: 12px; }
.q-edit .top { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.q-edit .top .grow { flex: 1 1 320px; }
.choices-edit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice-edit { display: flex; align-items: center; gap: 10px; padding: 4px 10px; border-radius: 10px; border: 1px solid var(--input); background: #fff; }
.choice-edit:has(input[type=checkbox]:checked) { background: var(--green-soft); border: 2px solid var(--green); }
.choice-edit input[type=text] { flex: 1; min-width: 0; min-height: 40px; border: 0; background: transparent; font: inherit; font-size: 16px; }
.choice-edit label { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; }
.choice-edit input[type=checkbox] { width: 20px; height: 20px; }
.danger-zone { border: 2px solid #F0C2C6; background: #FFF9F9; }
.dropzone { border: 2px dashed #9AA5B8; border-radius: 16px; padding: 24px; background: #F7F9FC; display: flex; flex-direction: column; gap: 14px; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .course-cards, .grid-2, .choices-edit { grid-template-columns: minmax(0, 1fr); }
  .card, .card-dark { padding: 20px; }
  .auth-box { padding: 20px; }
  .logo { height: 42px; }
  .nav-sep { display: none; }
  .score-big b { font-size: 52px; }
}
