/* ═══════════════════════════════════════════════════════════
   OSK Marcin Szkolenia — Main Stylesheet
   ═══════════════════════════════════════════════════════════ */

:root {
  --primary:      #1e3a5f;
  --primary-dark: #122540;
  --primary-light:#2a5298;
  --accent:       #f59e0b;
  --accent-dark:  #d97706;
  --surface:      #f8fafc;
  --surface-card: #ffffff;
  --text:         #1e293b;
  --text-muted:   #64748b;
  --border:       #e2e8f0;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:       0 4px 16px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg:    0 10px 40px rgba(0,0,0,.14), 0 4px 12px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

/* ── Typography ──────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.3; }

/* ══════════════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════════════ */

.login-page {
  min-height: 100vh;
  display: flex;
}

.login-panel {
  width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 3.5rem;
  background: #fff;
  position: relative;
  z-index: 2;
}

.login-hero {
  flex: 1;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem;
}

.login-hero::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  top: -200px; right: -200px;
}
.login-hero::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  bottom: -150px; left: -100px;
}

.login-hero-content { position: relative; z-index: 1; }

.login-hero h2 {
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.login-hero p {
  color: rgba(255,255,255,.75);
  font-size: 1.05rem;
  max-width: 380px;
}

.login-features {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: rgba(255,255,255,.9);
}

.login-feature-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.login-logo-img {
  height: 50px;
  margin-bottom: 2rem;
}

.login-panel h1 {
  font-size: 1.7rem;
  color: var(--primary);
  margin-bottom: .25rem;
}

.login-panel .subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: .95rem;
}

.form-label-custom {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .4rem;
}

.form-control-custom {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
  background: #fff;
  color: var(--text);
}
.form-control-custom:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,58,95,.12);
}

.btn-login {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  border: none;
  padding: .85rem;
  width: 100%;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  margin-top: 1.5rem;
}
.btn-login:hover { opacity: .92; transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); }

@media (max-width: 768px) {
  .login-page { flex-direction: column; }
  .login-hero { min-height: 280px; padding: 2.5rem 2rem; }
  .login-hero h2 { font-size: 1.6rem; }
  .login-panel { width: 100%; padding: 2rem 1.5rem; min-height: auto; }
}

/* ══════════════════════════════════════════════════════════
   USER NAVBAR
   ══════════════════════════════════════════════════════════ */

.site-navbar {
  background: var(--primary);
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}

.navbar-brand-custom {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}

.navbar-brand-custom img {
  height: 36px;
  filter: brightness(0) invert(1);
}

.navbar-brand-custom .brand-name {
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -.01em;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.navbar-user {
  color: rgba(255,255,255,.8);
  font-size: .85rem;
  display: none;
}

.btn-nav {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-sm);
  padding: .45rem .9rem;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.btn-nav:hover { background: rgba(255,255,255,.22); color: #fff; }

.btn-nav-accent {
  background: var(--accent);
  border-color: var(--accent-dark);
  color: #1a1a1a;
}
.btn-nav-accent:hover { background: var(--accent-dark); color: #1a1a1a; }

@media (min-width: 640px) {
  .navbar-user { display: block; }
}

/* ══════════════════════════════════════════════════════════
   PAGE WRAPPER
   ══════════════════════════════════════════════════════════ */

.page-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.75rem;
  color: var(--primary);
  margin: 0;
}

/* ══════════════════════════════════════════════════════════
   DASHBOARD — TRAINING CARDS
   ══════════════════════════════════════════════════════════ */

.welcome-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  color: #fff;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.welcome-banner::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  right: -80px; top: -100px;
}

.welcome-banner h2 {
  font-size: 1.5rem;
  margin-bottom: .25rem;
}

.welcome-banner p {
  margin: 0;
  opacity: .8;
  font-size: .95rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .78rem;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--border);
}

.trainings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.training-card {
  background: var(--surface-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}

.training-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  text-decoration: none;
}

.training-card-cover {
  height: 140px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.training-card-cover::before {
  content: '';
  position: absolute;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  right: -50px; top: -50px;
}

.training-card-cover-icon {
  font-size: 3rem;
  opacity: .9;
}

.training-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.training-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .4rem;
  color: var(--primary);
}

.training-card-desc {
  font-size: .85rem;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.training-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-start {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--primary);
  color: #fff;
  padding: .5rem 1rem;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s;
}
.btn-start:hover { background: var(--primary-light); color: #fff; text-decoration: none; }

/* ══════════════════════════════════════════════════════════
   TRAINING PAGE — Chapters sidebar
   ══════════════════════════════════════════════════════════ */

.training-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  border-radius: var(--radius);
  padding: 2.5rem;
  color: #fff;
  margin-bottom: 2rem;
}

.training-hero h1 {
  color: #fff;
  font-size: 1.8rem;
  margin-bottom: .5rem;
}

.training-hero p {
  margin: 0;
  opacity: .8;
}

.training-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .training-layout {
    grid-template-columns: 280px 1fr;
  }
}

.chapter-nav {
  background: var(--surface-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  height: fit-content;
  position: sticky;
  top: 80px;
}

.chapter-nav-header {
  padding: 1rem 1.25rem;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.chapter-item {
  border-bottom: 1px solid var(--border);
}

.chapter-item:last-child { border-bottom: none; }

.chapter-title {
  padding: .9rem 1.25rem;
  font-weight: 700;
  font-size: .88rem;
  color: var(--primary);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
}

.lesson-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem 1.25rem .65rem 2rem;
  font-size: .85rem;
  color: var(--text);
  text-decoration: none;
  border-top: 1px solid var(--border);
  transition: background .15s, color .15s;
}

.lesson-link:hover {
  background: #eef2ff;
  color: var(--primary);
  text-decoration: none;
}

.lesson-link i { color: var(--text-muted); font-size: .8rem; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════
   LESSON PAGE
   ══════════════════════════════════════════════════════════ */

.lesson-wrapper {
  background: var(--surface-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.lesson-header {
  padding: 2rem 2.5rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to right, var(--surface) 0%, #fff 100%);
}

.lesson-header .breadcrumb {
  margin-bottom: .75rem;
}

.lesson-header h1 {
  font-size: 1.6rem;
  color: var(--primary);
  margin: 0;
}

.lesson-body {
  padding: 2rem 2.5rem;
}

.lesson-text {
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--text);
  max-width: 760px;
}

.lesson-text h2 { font-size: 1.35rem; margin-top: 2rem; color: var(--primary); }
.lesson-text h3 { font-size: 1.15rem; margin-top: 1.5rem; color: var(--primary); }
.lesson-text p  { margin-bottom: 1.1rem; }
.lesson-text ul, .lesson-text ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.lesson-text li { margin-bottom: .4rem; }
.lesson-text strong { color: var(--primary); }
.lesson-text blockquote {
  border-left: 4px solid var(--accent);
  padding: .75rem 1.25rem;
  background: #fffbeb;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
  color: #92400e;
}

.lesson-image {
  text-align: center;
  max-width: 100%;
}

.lesson-image img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.lesson-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #000;
}

.lesson-video iframe,
.lesson-video video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* ── Quiz ─────────────────────────────────────────────────── */
.quiz-section {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 2px solid var(--border);
}

.quiz-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.75rem;
}

.quiz-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--primary);
}

.quiz-badge {
  background: var(--accent);
  color: #78350f;
  font-size: .75rem;
  font-weight: 700;
  padding: .25rem .65rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.quiz-result-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-sm);
  margin-bottom: 2rem;
  font-weight: 600;
}

.quiz-result-banner.perfect {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}

.quiz-result-banner.partial {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1e40af;
}

.quiz-result-score {
  font-size: 2rem;
  font-weight: 800;
}

.question-block {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.question-block:last-child { border-bottom: none; }

.question-text {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.question-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: .8rem;
  font-weight: 700;
  margin-right: .6rem;
  flex-shrink: 0;
}

.answer-option {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem 1rem;
  margin-bottom: .5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.answer-option:hover {
  border-color: var(--primary);
  background: #f0f4ff;
}

.answer-option input { margin-top: 2px; flex-shrink: 0; }

.answer-option.correct {
  border-color: #10b981;
  background: #ecfdf5;
}

.answer-option.wrong {
  border-color: #ef4444;
  background: #fef2f2;
}

.answer-label { font-size: .95rem; line-height: 1.5; }

.btn-quiz {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--accent);
  color: #78350f;
  padding: .8rem 1.75rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .95rem;
  border: none;
  cursor: pointer;
  transition: background .2s, transform .1s;
  margin-top: 1rem;
}
.btn-quiz:hover { background: var(--accent-dark); transform: translateY(-1px); }

.btn-retry {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: transparent;
  color: var(--primary);
  padding: .8rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  border: 1.5px solid var(--primary);
  cursor: pointer;
  text-decoration: none;
  transition: background .2s;
}
.btn-retry:hover { background: #eef2ff; color: var(--primary); text-decoration: none; }

/* ── Lesson navigation ────────────────────────────────────── */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 2.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.btn-lesson-nav {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .88rem;
  text-decoration: none;
  transition: all .2s;
  max-width: 48%;
}

.btn-lesson-prev {
  background: #fff;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-lesson-prev:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

.btn-lesson-next {
  background: var(--primary);
  color: #fff;
  border: 1.5px solid var(--primary);
  margin-left: auto;
}
.btn-lesson-next:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }

.btn-lesson-finish {
  background: #059669;
  color: #fff;
  border: 1.5px solid #059669;
  margin-left: auto;
}
.btn-lesson-finish:hover { background: #047857; color: #fff; text-decoration: none; }

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb { margin: 0; padding: 0; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }
.breadcrumb-item a { color: var(--primary); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: .4;
}
.empty-state p { font-size: 1rem; margin: 0; }

/* ── Responsive tweaks ────────────────────────────────────── */
@media (max-width: 640px) {
  .lesson-header, .lesson-body { padding: 1.25rem; }
  .lesson-nav { padding: 1rem 1.25rem; flex-direction: column; }
  .btn-lesson-nav { max-width: 100%; }
  .btn-lesson-next, .btn-lesson-finish { margin-left: 0; }
  .training-hero { padding: 1.5rem; }
  .training-hero h1 { font-size: 1.4rem; }
  .welcome-banner { padding: 1.5rem; }
}
