html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/Poppins-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/Poppins-SemiBold.ttf') format('truetype');
}

@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/Poppins-Bold.ttf') format('truetype');
}

@font-face {
  font-family: 'Archicoco Regular';
  font-style: normal;
  font-weight: normal;
  src: local('Archicoco Regular'), url('fonts/Archicoco.woff') format('woff');
}

:root {
  color-scheme: light;
  --primary: #1a3d7c;
  --accent: #2ec4b6;
  --bg: #fff;
  --card-bg: #ffffff;
  --text: #333;
  --danger: #e63946;
  --success: #2a9d8f;
  --shell-surface: var(--card-bg);
  --shell-section-surface: #eef2fb;
  --shell-border: rgba(17, 23, 41, 0.08);
  --shell-text-strong: var(--primary);
  --shell-muted: #5a6170;
  --shell-accent: var(--accent);
  --shell-avatar-bg: var(--primary);
  --shell-max-width: min(1180px, 92vw);
  --card-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  --answer-bg: #f9f9f9;
  --answer-border: #ddd;
  --answer-checked-bg: #e0f7f5;
  --table-border: #ddd;
  --summary-bar-bg: #eee;
  --qa-border: #ddd;
  --qa-bg: #fafafa;
  --muted-text: #555;
  --footer-text: #fff;
  --footer-bg: #000;
  --progress-bg: #eee;
  --progress-text: #222;
  --input-border: #ddd;
	--title-color: #000;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --primary: #8fb4ff;
  --accent: #5eead4;
  --bg: #0f172a;
  --card-bg: #1f2937;
  --text: #e2e8f0;
  --danger: #f87171;
  --success: #34d399;
  --shell-surface: #111c2f;
  --shell-section-surface: #16213b;
  --shell-border: rgba(148, 163, 184, 0.2);
  --shell-text-strong: #f8fafc;
  --shell-muted: #94a3b8;
  --shell-accent: var(--accent);
  --shell-avatar-bg: #334155;
  --card-shadow: 0 12px 32px rgba(15, 23, 42, 0.65);
  --answer-bg: rgba(148, 163, 184, 0.16);
  --answer-border: rgba(148, 163, 184, 0.45);
  --answer-checked-bg: rgba(94, 234, 212, 0.18);
  --table-border: rgba(148, 163, 184, 0.4);
  --summary-bar-bg: rgba(148, 163, 184, 0.12);
  --qa-border: rgba(148, 163, 184, 0.45);
  --qa-bg: rgba(148, 163, 184, 0.1);
  --muted-text: #cbd5f5;
  --footer-text: #fff;
  --footer-bg: #000;
  --progress-bg: rgba(148, 163, 184, 0.2);
  --progress-text: #041b17;
  --input-border: rgba(148, 163, 184, 0.5);
	--title-color: #fff;
}

body {
  font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


.app-header {
  background: var(--shell-surface);
  border-bottom: 1px solid var(--shell-border);
}

.app-header__top {
  width: var(--shell-max-width);
  margin: 0 auto;
  padding: 18px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.app-header__branding {
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-header__logo {
  display: inline-flex;
  width: 70px;
  height: 70px;
}

.app-header__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-header__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.app-header__title {
  font-family: 'Archicoco Regular', 'Poppins', 'Terminess Nerd Font Bold', 'Terminess Nerd Font', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1.4rem;
  font-weight: 400;
	color: var(--title-color);
  text-decoration: none;
  line-height: 1.1;
	margin-bottom: 8px;
}

.app-header__title:hover,
.app-header__title:focus-visible {
  color: #1a3d7c;
  text-decoration: none;
}

.app-header__section {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--shell-muted);
}

.app-header__support {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 22px;
  border-radius: 13px;
  background: #f92f2f;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-header__support:hover,
.app-header__support:focus-visible {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(249, 47, 47, 0.25);
}

.app-header__actions {
  display: flex;
  align-items: center;
}

.app-header__icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  padding: 0;
  color: inherit;
}

.app-header__icon-button:hover,
.app-header__icon-button:focus-visible {
  background: rgba(26, 61, 124, 0.12);
  transform: translateY(-1px);
  text-decoration: none;
}

.app-header__icon-button:focus-visible {
  outline: 2px solid var(--shell-accent);
  outline-offset: 2px;
}

.app-header__icon {
  width: 40px;
  height: 40px;
  display: block;
}

.app-nav {
  background: var(--shell-surface);
  border-top: 1px solid var(--shell-border);
}

.app-nav__inner {
  width: var(--shell-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  padding: 14px 0;
}

.app-nav__link {
  position: relative;
  padding-bottom: 6px;
  color: var(--shell-muted);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.app-nav__link:hover,
.app-nav__link:focus-visible {
  color: var(--shell-text-strong);
  text-decoration: none;
}

.app-nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 3px;
  background: transparent;
  border-radius: 2px;
  transition: background 0.2s ease;
}

.app-nav__link:hover::after,
.app-nav__link:focus-visible::after,
.app-nav__link--active::after {
  background: #2ec4b6;
}

.app-nav__link--active {
  color: var(--shell-text-strong);
}

.quiz-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.highlight-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  font-weight: 600;
  color: var(--muted-text);
  cursor: pointer;
  user-select: none;
}

.highlight-toggle__input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
}

.highlight-toggle__switch {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--answer-border);
  transition: background 0.2s ease;
}

.highlight-toggle__switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.highlight-toggle__input:checked + .highlight-toggle__switch {
  background: var(--accent);
}

.highlight-toggle__input:checked + .highlight-toggle__switch::after {
  transform: translateX(20px);
}

.highlight-toggle__input:focus-visible + .highlight-toggle__switch {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.highlight-toggle__text {
  font-size: 0.95rem;
  color: inherit;
}

h1, h2, h3 {
  color: var(--primary);
  margin-bottom: 0.5em;
}

.container {
  max-width: 1000px;
  margin: auto;
  padding: 20px;
}

.card {
  border-radius: 12px;
  padding: 0 20px 20px 20px;
  margin-bottom: 20px;
  transition: background 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  margin: 5px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.3s;
}
.btn:hover {
  background: var(--accent);
}

.btn-exam-start {
  background: #2ec4b6;
  color: #fff;
}
.btn-exam-start:hover {
  background: #057d63;
}

.btn-full-start {
  background: #8fb4ff;
  color: #fff;
}
.btn-full-start:hover {
  background: #064345;
}

.answers label {
  display: block;
  background: var(--answer-bg);
  border: 2px solid var(--answer-border);
  border-radius: 10px;
  padding: 12px;
  margin: 8px 0;
  cursor: pointer;
  transition: all 0.3s;
  color: var(--text);
}
.answers input {
  display: none;
}
.answers input:checked + label {
  border-color: var(--accent);
}
.answers label.answer-highlight-correct {
  border-color: var(--success);
  background: rgba(42, 157, 143, 0.15);
  color: var(--success);
}
.answers label.answer-highlight-incorrect {
  border-color: var(--danger);
  background: rgba(230, 57, 70, 0.15);
  color: var(--danger);
}
.answers.answers--locked label {
  pointer-events: none;
  cursor: default;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
table th, table td {
  border: 1px solid var(--table-border);
  padding: 8px 12px;
  text-align: center;
}
table th {
  background: var(--primary);
  color: white;
}

.chart-container {
  width: 100%;
  overflow-x: auto;
}

.success { color: var(--success); font-weight: bold; }
.error { color: var(--danger); font-weight: bold; }
.red { background: var(--danger); color: white; }

.nav-bottom {
	text-align: center;
}


@media (max-width: 768px) {
  .container { padding: 10px; }
  h1 { font-size: 1.2em; }
  .app-header__top {
    flex-direction: row;
    align-items: stretch;
    gap: 20px;
  }
  .app-header__branding {
    justify-content: flex-start;
  }
  .app-header__actions {
    width: 100%;
    justify-content: flex-end;
  }
  .app-nav__inner {
    flex-wrap: wrap;
    gap: 32px;
  }
	.app-header__support {
		padding: 9px 12px;
		border-radius: 12px;
		font-size: 0.8em;
	}
	.app-nav__inner {
		gap: 24px;
		padding: 7px 0;
	}
	.app-nav__link::after {
		bottom: -1px;
		height: 3px;
	}
	.app-nav__link {
		font-size: 0.8em;
	}
	.app-header__title {
		font-size: 1.6em;
		color: var(--title-color);
	}
	.btn {
		padding: 16px 16px;
		margin: 5px;
		border-radius: 12px;
	}
	.btn-big {
		font-size: 1.1em !important;
		text-align: center;
	}
	.card {
		margin-bottom: 0;
	}
}

@media (max-width: 600px) {
  .qr-desktop { display: none; }
  .intro-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .intro-cta {
    align-items: stretch;
  }
  .intro-actions .btn {
    width: 80%;
  }
	.card {
		margin-bottom: 0;
	}
}

.summary-bar {
  background: var(--summary-bar-bg);
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-weight: 500;
}

/* additional styles for summary list */
.qa {
  margin-bottom: 15px;
  padding: 10px;
  border-left: 5px solid var(--qa-border);
  background: var(--qa-bg);
  border-radius: 6px;
}
.qa p {
  margin: 5px 0;
}
.correct {
  color: var(--success);
  font-weight: bold;
}
.wrong {
  color: var(--danger);
  font-weight: bold;
}
.qa details {
  margin-top: 8px;
}
.qa details summary {
  cursor: pointer;
  color: var(--primary);
}
.qa details ul {
  margin: 6px 0 0 20px;
  padding: 0;
}
.qa details li {
  margin: 4px 0;
}

/* Timer */
.timer-container {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
        font-size: 24px;
        color: var(--primary);
        font-weight: bold;
}

#pause-btn {
  width: 24px;
  height: 24px;
  cursor: pointer;
}

@media (max-width: 600px) {
  .timer-container {
    font-size: 18px;
  }

  #pause-btn {
    width: 18px;
    height: 18px;
  }

  .card h2 {
    margin-top: 0;
  }
}

/* Karty pytań w raporcie najgorszych pytań */
.qa-card {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: var(--card-shadow);
  color: var(--text);
}
.qa-card .question {
  font-weight: bold;
  margin-bottom: 10px;
}
.note {
  font-size: 0.9em;
  margin-top: 6px;
}

.qa-card details {
  margin-top: 8px;
}

.qa-card details summary {
  cursor: pointer;
  color: var(--primary);
}

.qa-card details ul {
  margin: 6px 0 0 20px;
  padding: 0;
}

.qa-card details li {
  margin: 4px 0;
}

/* Pasek postępu */
.progress {
  background: var(--progress-bg);
  border-radius: 6px;
  overflow: hidden;
  height: 22px;
  margin: 8px 0;
}
.bar {
  height: 100%;
  text-align: center;
  color: #fff;
  font-weight: bold;
  line-height: 22px;
  font-size: 0.85em;
}

/* Kolory pasków zależne od trudności */
.qa-card.hard .bar { background: #e63946; }   /* czerwony */
.qa-card.medium .bar { background: #ffb703; } /* żółty */
.qa-card.easy .bar { background: #2a9d8f; }   /* zielony */

/* Sekcja wprowadzenia */
.intro {
  font-size: 1.0em;
  line-height: 1.2;
}

.asteriks {
	font-size: 0.8em;
	text-align: right;
	margin-right: 15px;
}

.subtitle {
        font-size: 1.5em;
        color: #2ec4b6;
        font-weight: 700;
        text-align: left;
}

.intro-cta {
  display: flex;
  flex-direction: column;
	align-items: center;
}

.intro-cta__subtitle.subtitle {
  margin-top: 10px;
}

h1.intro-title {
  text-align: center;
	margin: 0.4em;
  line-height: 1.1em;
}

/* Statystyki */
.stats {
  display: flex;
  gap: 15px;
  margin: 20px 0;
  flex-wrap: wrap;
}
.stat-card {
  flex: 1;
  min-width: 180px;
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  padding: 15px;
  text-align: center;
  color: var(--text);
}
.stat-card h2 {
  color: var(--primary);
  margin: 0;
  font-size: 1.6em;
}
.stat-card p {
  margin: 0 0 5px 0;
  color: var(--muted-text);
}

/* Duży przycisk CTA */
.btn-big {
  font-size: 1.1em;
  padding: 14px 24px;
}
.btn-tiny {
    padding: 2px 6px;
    margin: 0px;
    border-radius: 5px;
}

/* Sekcja Learn More */
.learn-more {
  display: flex;
  align-items: center;
  gap: 20px;
}
.learn-text h2 {
  margin-top: 0;
  color: var(--primary);
}
.small-note {
  font-size: 0.9em;
  color: var(--muted-text);
}
.small-note a {
  color: var(--accent);
  text-decoration: none;
}
.small-note a:hover {
  text-decoration: underline;
}

/* Authentication forms */
.auth-card {
  max-width: 400px;
  margin: 40px auto;
}
.auth-extra-actions {
  margin-top: 10px;
  text-align: center;
}
.auth-extra-actions .btn {
  margin: 0;
}

.profile-container {
  max-width: 900px;
}

.profile-header {
  margin-bottom: 24px;
  color: var(--primary);
}

.profile-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.profile-card h2 {
  margin-top: 0;
}

.profile-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.profile-list li {
  color: var(--shell-muted);
  font-size: 0.95rem;
}

.profile-list strong {
  color: var(--shell-text-strong);
}

.profile-actions {
  margin-top: 24px;
  text-align: center;
}

.profile-actions .btn {
  margin: 0;
}

.auth-form label {
  display: block;
  margin-bottom: 10px;
}

.auth-form input {
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  margin-bottom: 12px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  box-sizing: border-box;
}

.auth-form .actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
	justify-content: right;
}

.answers .actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

/* Footer */
.footer {
  text-align: center;
  font-size: 0.56em;
  color: var(--footer-text);
	background: var(--footer-bg);
	padding: 10px 15px;
}
.footer a {
  color: var(--accent);
  text-decoration: none;
}
.footer a:hover {
  text-decoration: underline;
}
.footer-slogan {
	font-size: 17px;
	padding: 15px 10px;
}

/* Progress bar on stats page */
.progress-wrapper {
  width: 100%;
  background: var(--progress-bg);
  border-radius: 8px;
  overflow: hidden;
	margin-top: 30px;

}
.progress-bar {
  height: 30px;
  background: var(--accent);
  text-align: center;
  line-height: 30px;
  color: var(--progress-text);
  font-weight: bold;
}
.trend-diff {
  font-size: 0.7em;
  margin-left: 10px;
  color: var(--accent);
}

/* Strona Leitner */
.box-card {
	flex: 1;
	min-width: 150px;
	background: var(--card-bg);
	border-radius: 8px;
	padding: 15px;
	text-align: center;
	border: 2px solid #ddd;
	margin-top: 1em;
}
.box-card h3 {
	margin: 0;
	color: var(--primary);
}
.back-link {
	margin-top: 20px;
	display: inline-block;
}


/* Poradnik section on home page */
.intro-actions {
  display: flex;
  flex-wrap: nowrap;
	justify-content: center;
  align-items: stretch;
  gap: 20px;
}

.intro-actions .btn {
  flex: 0 0 auto;
}

.poradnik-link {
	display: none !important;
  flex: 1 1 200px;
  padding: 10px 20px;
  border: 2px solid var(--primary);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.poradnik-link:hover {
  background: var(--accent);
  color: white;
}

.poradnik-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: bold;
  color: var(--primary);
}

.poradnik-title {
  font-weight: bold;
}

.poradnik-subtitle {
  font-size: 0.9em;
}

