/* Matura z DigiVibe – strona główna. Kolory i czcionki jak na digivibe.com.pl. */
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("../fonts/figtree-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("../fonts/figtree-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Unbounded"; font-style: normal; font-weight: 500 600; font-display: swap;
  src: url("../fonts/unbounded-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Unbounded"; font-style: normal; font-weight: 500 600; font-display: swap;
  src: url("../fonts/unbounded-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #05151D;
  --bg-2: #071C26;
  --surface: #0A2530;
  --surface-2: #0D3040;
  --ink: #E6F4F8;
  --ink-soft: #A1C3D1;
  --line: #16404F;
  --brand: #015670;
  --accent: #35D3EA;
  --accent-ink: #05151D;
  --error: #FF9B8A;
  --ok: #5EE6A8;

  /* kolory przedmiotów – te same w animacji (js/hero.js) */
  --mat: #35D3EA;
  --fiz: #7FA8FF;
  --che: #5EE6A8;
  --bio: #B3E26A;
  --geo: #F2C66D;
  --his: #FF9B8A;
  --ang: #C9A2FF;
  --hisz: #FF85BC;

  --head: "Unbounded", "Segoe UI", system-ui, sans-serif;
  --text: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 14px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(1200px, 100% - 2.5rem); margin-inline: auto; }
.wrap-narrow { width: min(780px, 100% - 2.5rem); }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: .6rem 1rem; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* ---------- przyciski ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 46px; padding: .7rem 1.3rem; border-radius: 999px; border: 1px solid transparent;
  font: 600 1rem/1 var(--text); text-decoration: none; cursor: pointer;
  transition: transform .16s var(--ease-out), background-color .2s, border-color .2s, color .2s;
}
.btn:active { transform: scale(.97); }
.btn-cta { background: var(--accent); color: var(--accent-ink); width: 100%; }
.btn-ghost { color: var(--ink); background: transparent; border-color: var(--line); }
@media (hover: hover) and (pointer: fine) {
  .btn-cta:hover { background: #5FE0F1; }
  .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
}
.btn[aria-busy="true"] { opacity: .7; pointer-events: none; }

/* ---------- nagłówek ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.top-in { display: flex; align-items: center; gap: 2rem; min-height: 68px; }
.logo { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; font: 600 1rem/1 var(--head); }
.logo em { font-style: normal; color: var(--accent); }
.top nav { margin-left: auto; }
.top nav ul { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.top nav a { color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.top nav a:hover { color: var(--ink); }
.top-login { min-height: 40px; padding: .55rem 1.1rem; white-space: nowrap; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(1.5rem, 4vw, 3.5rem) 0 clamp(3rem, 6vw, 5rem); }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto; height: 120%; pointer-events: none;
  background:
    radial-gradient(48% 55% at 28% 42%, rgba(1, 86, 112, .42), transparent 70%),
    radial-gradient(30% 40% at 85% 30%, rgba(53, 211, 234, .10), transparent 70%);
}
.hero-in { position: relative; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
.hero-art { position: relative; min-width: 0; }
#hero-canvas { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; max-height: 440px; touch-action: pan-y; }
.hero-title {
  font-size: clamp(2.6rem, 7vw, 5.4rem); letter-spacing: -.02em; margin-bottom: 1rem;
}
.hero-title span { display: block; color: var(--accent); font-size: .62em; }
/* gdy animacja działa, napis tworzy płótno; h1 zostaje dla czytników i wyszukiwarek */
.js-hero .hero-title {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; margin: 0;
}
html:not(.js-hero) #hero-canvas { display: none; }
.hero-lead { max-width: 38rem; color: var(--ink-soft); font-size: clamp(1.05rem, 1.6vw, 1.2rem); margin-top: .5rem; }
.hero-lead strong { color: var(--ink); }
.hero-subjects { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; padding: 0; margin: 1.4rem 0 0; }
.hero-subjects li {
  font-size: .85rem; font-weight: 500; padding: .3rem .7rem; border-radius: 999px;
  color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  background: color-mix(in srgb, var(--c) 8%, transparent);
}

/* ---------- panel logowania ---------- */
.auth { scroll-margin-top: 90px; }
.auth-card {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line); border-radius: 20px; padding: 1.5rem;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg); border-radius: 999px; margin-bottom: 1.4rem; }
.tabs button {
  min-height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft);
  font: 600 .95rem/1 var(--text); cursor: pointer; transition: background-color .2s, color .2s;
}
.tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--ink); }
.auth-h { font-size: 1.25rem; margin-bottom: 1.1rem; }
.auth-form { display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 600; font-size: .95rem; }
.field small { color: var(--ink-soft); font-size: .85rem; }
.field input {
  width: 100%; min-height: 48px; padding: .7rem .9rem; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink);
  font: 400 16px/1.2 var(--text); /* 16px: telefon nie powiększa strony */
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(53, 211, 234, .2); }
.field input[aria-invalid="true"] { border-color: var(--error); }
.field .err { color: var(--error); font-size: .88rem; }
.pass { position: relative; }
.pass input { padding-right: 5.2rem; }
.pass-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  min-height: 36px; padding: 0 .8rem; border: 0; border-radius: 8px; background: transparent;
  color: var(--accent); font: 600 .88rem/1 var(--text); cursor: pointer;
}
.auth-row { display: flex; justify-content: flex-end; margin-top: -.4rem; }
.link { border: 0; background: none; color: var(--accent); font: 500 .9rem/1.4 var(--text); cursor: pointer; padding: .25rem 0; text-decoration: underline; text-underline-offset: 3px; }
.check { display: flex; gap: .65rem; align-items: flex-start; font-size: .92rem; color: var(--ink-soft); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: .1rem 0 0; flex: none; accent-color: var(--accent); }
.check[data-invalid] span { color: var(--error); }
.msg { min-height: 1.4em; font-size: .93rem; color: var(--ink-soft); }
.msg:empty { display: none; }
.msg[data-type="err"] { color: var(--error); }
.msg[data-type="ok"] { color: var(--ok); }
.msg[data-type="info"] { color: var(--ink); background: var(--surface-2); border-left: 3px solid var(--accent); padding: .7rem .9rem; border-radius: 8px; }
.rodo { font-size: .78rem; line-height: 1.5; color: var(--ink-soft); opacity: .85; }
.try { display: inline-block; margin-top: 1rem; padding: .5rem .25rem; color: var(--ink); font-weight: 600; text-decoration: none; }
.try span { display: inline-block; color: var(--accent); transition: transform .2s var(--ease-out); }
.try:hover span { transform: translateX(4px); }

/* ---------- sekcje ---------- */
.sec { padding: clamp(3.5rem, 8vw, 6.5rem) 0; scroll-margin-top: 60px; }
.sec-alt { background: var(--bg-2); border-block: 1px solid color-mix(in srgb, var(--line) 50%, transparent); }
.eyebrow { color: var(--accent); font-weight: 600; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .8rem; }
.sec h2 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); max-width: 22ch; margin-bottom: clamp(2rem, 4vw, 3rem); }

.subjects { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.subj {
  position: relative; display: flex; flex-direction: column; gap: .5rem; padding: 1.3rem;
  border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); min-height: 160px;
}
.subj-f { font: 500 .95rem/1.2 "Cambria Math", "Segoe UI", serif; color: var(--c); opacity: .9; margin-bottom: auto; padding-bottom: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subj h3 { font-size: 1.02rem; }
.subj p { color: var(--ink-soft); font-size: .92rem; }
.subj:not(.is-on) { opacity: .72; }
.subj.is-on { grid-column: span 2; border-color: color-mix(in srgb, var(--c) 45%, var(--line)); background: linear-gradient(160deg, color-mix(in srgb, var(--c) 10%, var(--surface)), var(--surface) 60%); }
.subj.is-on .subj-f { font-size: 1.3rem; }
.subj-go { margin-top: .6rem; font-weight: 600; align-self: flex-start; }
.subj-go::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }

.steps { list-style: none; counter-reset: k; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.steps li { counter-increment: k; padding-top: 1.2rem; border-top: 2px solid var(--line); }
.steps li::before { content: counter(k, decimal-leading-zero); display: block; font: 600 .9rem/1 var(--head); color: var(--accent); margin-bottom: 1rem; }
.steps h3, .feats h3 { font-size: 1.08rem; margin-bottom: .6rem; }
.steps p, .feats p { color: var(--ink-soft); }

.feats { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.feats li { padding: 1.5rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }

.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 1.15rem 2.5rem 1.15rem 0; position: relative;
  font-weight: 600; font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: .3rem; top: 50%; transform: translateY(-50%);
  font: 500 1.4rem/1 var(--head); color: var(--accent); transition: transform .2s var(--ease-out);
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { color: var(--ink-soft); padding: 0 0 1.2rem; max-width: 60ch; }

.foot { padding: 2.5rem 0 calc(2.5rem + env(safe-area-inset-bottom)); color: var(--ink-soft); font-size: .9rem; }
.foot-in { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
.foot ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.foot a { color: var(--ink-soft); }
.foot a:hover { color: var(--ink); }

/* ---------- podstrony konta ---------- */
.page-narrow { width: min(640px, 100% - 2.5rem); margin-inline: auto; }
.page-h { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 1.5rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.4rem; margin-bottom: 1rem; display: grid; gap: 1rem; }
.panel h2 { font-size: 1.1rem; }
.panel .auth-form + .auth-form { border-top: 1px solid var(--line); padding-top: 1rem; }
.panel .btn-ghost { justify-self: start; }
.panel-p { color: var(--ink-soft); font-size: .95rem; }
.row-btns { display: flex; flex-wrap: wrap; gap: .6rem; }
.panel-danger { border-color: color-mix(in srgb, var(--error) 45%, var(--line)); }
.btn-danger { background: transparent; color: var(--error); border-color: color-mix(in srgb, var(--error) 60%, transparent); justify-self: start; }
@media (hover: hover) and (pointer: fine) { .btn-danger:hover { background: color-mix(in srgb, var(--error) 12%, transparent); } }

/* ---------- responsywność ---------- */
@media (max-width: 1000px) {
  .hero-in { grid-template-columns: 1fr; }
  .auth { max-width: 520px; width: 100%; margin-inline: auto; }
  .subjects { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .top nav { display: none; }
  .top-login { margin-left: auto; }
  #hero-canvas { aspect-ratio: 2 / 1; }
  .logo { font-size: .9rem; white-space: nowrap; }
  .top-in { gap: 1rem; }
  .hero { padding-top: .75rem; }
  .subjects, .steps, .feats { grid-template-columns: 1fr; }
  .subj.is-on { grid-column: auto; }
  .subj { min-height: 0; }
  .auth-card { padding: 1.15rem; }
}

/* Panel administratora (admin.html) */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.adm.sec { padding-top: clamp(1.5rem, 4vw, 2.5rem); }
.adm-nav { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: -0.5rem 0 1.2rem; font-size: .95rem; }
.adm-kafle { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .7rem; }
.adm-kafel { background: var(--surface-2); border-radius: 10px; padding: .8rem 1rem; display: grid; gap: .15rem; }
.adm-kafel b { font: 600 1.6rem/1.1 var(--head); color: var(--accent); }
.adm-kafel span { color: var(--ink-soft); font-size: .9rem; }
.adm-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem 1rem; align-items: end; }
.adm-form-1 { grid-template-columns: minmax(0, 360px); }
.adm-form .btn-cta { width: auto; }
.adm-form .msg { grid-column: 1 / -1; }
.field select, .adm-tab input[type=date] { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; color-scheme: dark; }
.adm-tab { overflow-x: auto; }
.adm-tab table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.adm-tab th, .adm-tab td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.adm-tab th { color: var(--ink-soft); font-weight: 600; font-size: .85rem; }
.adm-tab small, .adm-szary { color: var(--ink-soft); }
.adm-mały { min-height: 36px; padding: .35rem .8rem; font-size: .88rem; }
.st-aktywny { color: var(--ok); }
.st-wyłączony, .st-wygasł, .st-wykorzystany { color: var(--ink-soft); }
.adm-filtry { display: flex; flex-wrap: wrap; gap: 1rem; }
.adm-filtr { max-width: 320px; }
.adm-zgl { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.adm-z { border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem; display: grid; gap: .4rem; }
.adm-z.st-nowe { border-left: 3px solid var(--accent); }
.adm-z-m { color: var(--ink-soft); font-size: .85rem; }
.adm-z-t { white-space: pre-wrap; background: var(--bg); border-radius: 8px; padding: .6rem .8rem; }
.adm-pusto { color: var(--ink-soft); }
.p-latwe { color: var(--ok); } .p-srednie { color: var(--geo); } .p-trudne { color: var(--error); }

/* Regulamin i polityka prywatności */
.doc { line-height: 1.65; }
.doc h2 { font-size: 1.15rem; margin: 2rem 0 .6rem; }
.doc p, .doc li { color: var(--ink); max-width: 70ch; }
.doc p + p { margin-top: .7rem; }
.doc ul, .doc ol { padding-left: 1.3rem; display: grid; gap: .45rem; margin: .6rem 0; }
.doc a { color: var(--accent); }
.doc code { font-size: .9em; background: var(--surface); padding: .05em .35em; border-radius: 5px; }
.doc-lead { font-size: 1.08rem; color: var(--ink-soft); }
.doc-data { color: var(--ink-soft); font-size: .9rem; margin-top: .5rem; }
