/* ============= Design tokens ============= */
:root{
  --color-bg: #0d1117;          
  --color-surface: #161b22;     
  --color-text: #e6edf3;        
  --color-muted: #8b949e;       
  --color-primary: #58a6ff;     
  --color-primary-contrast: #0d1117;
  --color-border: #30363d;      
  --color-danger: #f85149;      

  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-24: 24px;
  --sp-32: 32px;

  --r-12: 12px;
  --shadow-card: 0 8px 24px rgba(0,0,0,.5);
  --focus-ring: 0 0 0 3px rgba(88,166,255,.35);
  --max-card: 400px;
}

/* ============= Reset ============= */
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body {
  background: url("images/tlo.png") no-repeat center center fixed;
  background-size: cover;
  color: var(--color-text);
  font-family: system-ui, sans-serif;
}


/* ============= Header ============= */
.site-header{
  padding: var(--sp-16);
  display:flex;
  justify-content:center;
}
.site-header__brand{
  width:48px;height:48px;
  border-radius:50%;
  background:linear-gradient(135deg,#58a6ff,#238636);
  box-shadow:0 0 15px rgba(88,166,255,.4);
}

/* ============= Layout logowania ============= */
.auth__main{
  flex:1;
  display:flex;
  justify-content:center;
  align-items:center;
  padding: var(--sp-24);
}
.auth-card{
  width:100%;
  max-width:var(--max-card);
  background:var(--color-surface);
  border:1px solid var(--color-border);
  border-radius:var(--r-12);
  box-shadow:var(--shadow-card);
  padding: var(--sp-32);
  animation: fadeIn .6s ease;
}
.auth-card__title{
  font-size:1.5rem;
  font-weight:700;
  margin-bottom: var(--sp-24);
  text-align:center;
}

/* ============= Formularz ============= */
.auth-form{display:grid;gap:var(--sp-16);}
.field{display:grid;gap:var(--sp-8);}
.field__label{font-size:14px;color:var(--color-muted)}
.field__input{
  padding:12px 14px;
  border-radius:var(--r-12);
  border:1px solid var(--color-border);
  background:#0d1117;
  color:var(--color-text);
  outline:none;
  transition:border-color .2s, box-shadow .2s;
}
.field__input:focus{box-shadow:var(--focus-ring);border-color:var(--color-primary);}
.field__input[aria-invalid="true"]{border-color:var(--color-danger);}
.field__error{color:var(--color-danger);font-size:13px;}

/* ============= Komunikaty ============= */
.auth-alert{
  padding:12px 14px;
  border:1px solid rgba(248,81,73,.4);
  background:rgba(248,81,73,.08);
  color:#ffb4ae;
  border-radius:var(--r-12);
  font-size:14px;
  margin-bottom:var(--sp-16);
}

/* ============= Przycisk ============= */
.btn{
  padding:12px 16px;
  border-radius:var(--r-12);
  font-weight:600;
  cursor:pointer;
  border:none;
  transition:background .2s, transform .1s;
}
.btn--full{width:100%}
.btn--primary{
  background:var(--color-primary);
  color:var(--color-primary-contrast);
}
.btn--primary:hover{background:#79b8ff;transform:translateY(-1px);}
.btn[disabled]{opacity:.6;cursor:not-allowed}

/* ============= Checkbox ============= */
.checkbox{display:flex;gap:10px;align-items:center;color:var(--color-muted);font-size:14px;}
.checkbox input{width:18px;height:18px}

/* ============= Animacje ============= */
@keyframes fadeIn{from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:none;}}

/* ============= Wybór ścieżki (path) ============= */
.paths{
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
  padding: var(--sp-24);
}
.paths__card{
  width: 100%;
  max-width: 820px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-12);
  box-shadow: var(--shadow-card);
  padding: clamp(var(--sp-24), 4vw, var(--sp-32));
  animation: fadeIn .6s ease;
}
.paths__title{
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--sp-24);
}

.tiles{
  display: grid;
  gap: var(--sp-24);
  grid-template-columns: 1fr;
}
@media (min-width: 640px){
  .tiles{ grid-template-columns: 1fr 1fr; }
}

.tile{
  display: grid;
  gap: 8px;
  padding: var(--sp-24);
  text-decoration: none;
  color: var(--color-text);
  background: #0d1117;
  border: 1px solid var(--color-border);
  border-radius: var(--r-12);
  transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease;
  outline: none;
}
.tile:hover{ transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.35); border-color: #3b82f6; }
.tile:focus{ box-shadow: var(--focus-ring); border-color: var(--color-primary); }
.tile__icon{ font-size: 36px; line-height: 1; }
.tile__title{ font-size: 18px; font-weight: 700; }
.tile__desc{ font-size: 14px; color: var(--color-muted); }

/* ===== Header: przycisk „Powrót” ===== */
.site-header__back{
  text-decoration: none;
  padding: 10px 14px;
  border-radius: var(--r-12);
  border: 1px solid var(--color-border);
  background: rgba(255,255,255,0.02);
  color: var(--color-text);
  font-weight: 600;
}
.site-header__back:hover{ border-color: #3b82f6; }

/* ===== Subjects page ===== */
.subjects{
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
  padding: var(--sp-24);
}
.subjects__card{
  width: 100%;
  max-width: 1000px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-12);
  box-shadow: var(--shadow-card);
  padding: clamp(var(--sp-24), 4vw, var(--sp-32));
  animation: fadeIn .6s ease;
}
.subjects__title{
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--sp-16);
}
.subjects__path{
  text-align:center;
  color: var(--color-muted);
  margin-bottom: var(--sp-24);
}

.subject{
  position: relative;
  padding-top: calc(var(--sp-24) + 6px);
}
.subject__status{
  position: absolute;
  top: 12px; right: 12px;
  width: 10px; height: 10px;
  border-radius: 999px;
  background: #3b3f45; /* neutral */
  box-shadow: 0 0 0 2px rgba(0,0,0,.3);
}
.subject__status--done{
  background: #22c55e; 
}

/* ===== Lekcje: stan ukończenia ===== */
.tile--done{
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34,197,94,.18) inset, 0 10px 24px rgba(0,0,0,.35);
}

.tile__badge{
  display:inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--color-border);
  background: rgba(255,255,255,0.02);
  color: var(--color-text);
  margin-top: 8px;
}
.tile__badge--muted{
  opacity: .7;
}

/* Stepper */
.stepper{ display:grid; gap: var(--sp-16); }
.stepper__nav{
  list-style:none; padding:0; margin:0;
  display:flex; gap:8px; flex-wrap:wrap;
}
.stepper__nav li{ }
.stepper__nav button{
  padding:8px 12px; border-radius:999px; border:1px solid var(--color-border);
  background:#0d1117; color:var(--color-text); cursor:pointer; font-weight:600;
}
.stepper__nav li.is-active button{ border-color:#3b82f6; box-shadow:0 0 0 2px rgba(59,130,246,.15); }
.stepper__panel{
  background:var(--color-surface); border:1px solid var(--color-border);
  border-radius:var(--r-12); box-shadow:var(--shadow-card);
  padding: clamp(var(--sp-24), 4vw, var(--sp-32));
}
.stepper__head{ display:flex; align-items:center; gap:12px; margin-bottom:8px; }
.stepper__icon{ font-size:22px; }
.stepper__list{ padding-left:18px; display:grid; gap:6px; margin: 8px 0 12px 0; }
.stepper__actions{ display:flex; gap:10px; flex-wrap:wrap; margin-top:8px; }
.miniCheck__q{ font-weight:700; margin:6px 0; }
.miniCheck__fb{ margin-top:6px; font-weight:700; }
.miniCheck__fb.ok{ color:#22c55e; } .miniCheck__fb.bad{ color:#f85149; }

/* Layout w panelu: teoria | mini-check  */
.stepper__content{
  display: grid;
  gap: 16px;
}
@media (min-width: 860px){
  .stepper__content{
    grid-template-columns: 1fr 340px;
    align-items: start;
  }
}

/* Karta mini-quizu – inny „look” niż teoria */
.miniCard{
  border:1px solid #2a3340;            
  background: linear-gradient(180deg,#0f1520 0%, #0b1220 100%);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.miniCard__head{
  display:flex; align-items:center; gap:10px; margin-bottom:10px;
}
.miniCard__icon{ font-size:20px; }
.miniCard__title{
  font-weight: 700; font-size: 14px; letter-spacing:.2px;
  color: #b7c6ff;
}
.miniCard__body label{ display:block; margin:6px 0; }
.miniCard__actions{ display:flex; gap:10px; justify-content:flex-end; margin-top:10px; }
.miniCard__fb{ margin-top:8px; font-weight:700; }
.miniCard__fb.ok{ color:#22c55e; } .miniCard__fb.bad{ color:#f85149; }

/* Drobna separacja sekcji teorii */
.stepper__list li + li{ margin-top: 2px; }
.stepper__subhead{
  margin: 8px 0 6px; font-weight:700; color: var(--color-text);
}
.stepper__divider{
  height:1px; background: linear-gradient(90deg,transparent,#2a3340,transparent);
  margin: 10px 0;
}

.option {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin: 8px 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-card, 0 1px 3px rgba(0,0,0,0.1));
}

.option:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

/* radio — własny wygląd */
.option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  margin-right: 10px;
  cursor: pointer;
  background: transparent;
  transition: border-color 0.2s, background-color 0.2s;
}

.option input[type="radio"]:checked {
  border-color: #22c55e;
  background-color: #22c55e;
}

.option:has(input[type="radio"]:checked) {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34,197,94,.12);
  background: rgba(34,197,94,.06);
  transform: translateY(-2px);
}

/* ===== WSPÓLNE STYLE LEKCJI ===== */
.lesson .container { max-width: 900px; margin: 0 auto; padding: var(--sp-24); }
.lesson .topbar { display:flex; gap:12px; align-items:center; justify-content:space-between; }
.lesson .title { font-size: clamp(22px,2.4vw,28px); font-weight: 700; margin: 8px 0; }
.lesson .muted { color: var(--color-muted); }
.lesson .card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--r-12); box-shadow: var(--shadow-card);
  padding: clamp(var(--sp-24), 4vw, var(--sp-32)); animation: fadeIn .6s ease;
}

/* mini-quiz w panelu */
.lesson .stepper__content{ display:grid; gap:16px; }
@media (min-width:860px){
  .lesson .stepper__content{ grid-template-columns:1fr 340px; align-items:start; }
}
.lesson .miniCard{
  border:1px solid #2a3340; background:linear-gradient(180deg,#0f1520 0%,#0b1220 100%);
  border-radius:12px; padding:14px 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.lesson .miniCard__head{ display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.lesson .miniCard__icon{ font-size:20px; }
.lesson .miniCard__title{ font-weight:700; font-size:14px; color:#b7c6ff; }
.lesson .miniCard__actions{ display:flex; gap:10px; justify-content:flex-end; margin-top:10px; }
.lesson .miniCard__fb.ok{ color:#22c55e; font-weight:700; }
.lesson .miniCard__fb.bad{ color:#f85149; font-weight:700; }
.lesson .stepper__divider{ height:1px; background:linear-gradient(90deg,transparent,#2a3340,transparent); margin:10px 0; }
.lesson .stepper__subhead{ margin:8px 0 6px; font-weight:700; }
.lesson .dialogA,.lesson .dialogB{
  display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px; margin-right:6px; font-size:14px; border-radius:50%; color:#fff;
}
.lesson .dialogA{ background:#3b82f6; } 
.lesson .dialogB{ background:#f59e0b; }

/* quiz (kafelki odpowiedzi + zielone radio) */
.lesson .question-box{ margin-bottom:16px; }
.lesson .option{
  display:flex; align-items:center; padding:12px 16px; margin:8px 0;
  border:1px solid var(--color-border); border-radius:8px;
  background:var(--color-surface); cursor:pointer; transition:all .2s;
  box-shadow: var(--shadow-card, 0 1px 3px rgba(0,0,0,.1));
}
.lesson .option:hover{ background:rgba(0,0,0,.05); transform:translateY(-2px); }
.lesson .option input[type="radio"]{
  appearance:none; -webkit-appearance:none; -moz-appearance:none;
  width:18px; height:18px; border:2px solid var(--color-border); border-radius:50%;
  margin-right:10px; background:transparent; transition:border-color .2s, background-color .2s;
}
.lesson .option input[type="radio"]:checked{ border-color:#22c55e; background-color:#22c55e; }
.lesson .option:has(input[type="radio"]:checked){
  border-color:#22c55e; box-shadow:0 0 0 2px rgba(34,197,94,.12);
  background:rgba(34,197,94,.06); transform:translateY(-2px);
}
.lesson .feedback{ margin-top:10px; font-weight:700; }
.lesson .correct{ color:#22c55e; } 
.lesson .incorrect{ color:#f85149; }
.lesson #quiz-container, 
.lesson #result { display:none; }


a.btn {
  text-decoration: none;   
  color: inherit;          
}

/* Ghost button – używany dla "Pokaż podpowiedź" */
.btn--ghost{
  background: rgba(255,255,255,0.02);
  color: var(--color-muted);              
  border: 1px solid var(--color-border);
}
.btn--ghost:hover{
  color: var(--color-text);
  border-color: #3b82f6;
  box-shadow: var(--focus-ring);
  transform: translateY(-1px);
}

.bg-tlo {
  background: url("../images/tlo.png") no-repeat center center fixed;
  background-size: cover;
}






