/* Global Styling & Variables */
:root {
  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --container-width: 1200px;
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Shadows */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(45, 212, 191, 0.15);

  /* Light Theme Colors */
  --bg-light: #fafaf9; /* Stone 50 */
  --bg-card-light: #ffffff;
  --bg-alt-light: #f5f5f4; /* Stone 100 */
  --text-light: #1c1917; /* Stone 900 */
  --text-muted-light: #6c6a67;
  --primary-light: #0f766e; /* Teal 700 */
  --primary-hover-light: #115e59; /* Teal 800 */
  --accent-light: #d97706; /* Amber 600 */
  --border-light: #e7e5e4; /* Stone 200 */
  --header-bg-light: rgba(250, 250, 249, 0.85);
  --scrollbar-track-light: #f5f5f4;
  --scrollbar-thumb-light: #d6d3d1;

  /* Dark Theme Colors */
  --bg-dark: #090d16; /* Deep dark space */
  --bg-card-dark: #131b2e; /* Deep card blue-slate */
  --bg-alt-dark: #0f172a; /* Slate 900 */
  --text-dark: #e2e8f0; /* Slate 200 */
  --text-muted-dark: #94a3b8; /* Slate 400 */
  --primary-dark: #2dd4bf; /* Teal 400 */
  --primary-hover-dark: #14b8a6; /* Teal 500 */
  --accent-dark: #fbbf24; /* Amber 400 */
  --border-dark: #1e293b; /* Slate 800 */
  --header-bg-dark: rgba(9, 13, 22, 0.85);
  --scrollbar-track-dark: #090d16;
  --scrollbar-thumb-dark: #334155;

  /* light-dark Bindings (Requires Baseline browser capability) */
  color-scheme: light dark;
  --bg: light-dark(var(--bg-light), var(--bg-dark));
  --bg-card: light-dark(var(--bg-card-light), var(--bg-card-dark));
  --bg-alt: light-dark(var(--bg-alt-light), var(--bg-alt-dark));
  --text: light-dark(var(--text-light), var(--text-dark));
  --text-muted: light-dark(var(--text-muted-light), var(--text-muted-dark));
  --primary: light-dark(var(--primary-light), var(--primary-dark));
  --primary-hover: light-dark(var(--primary-hover-light), var(--primary-hover-dark));
  --accent: light-dark(var(--accent-light), var(--accent-dark));
  --border: light-dark(var(--border-light), var(--border-dark));
  --header-bg: light-dark(var(--header-bg-light), var(--header-bg-dark));
  --scrollbar-track: light-dark(var(--scrollbar-track-light), var(--scrollbar-track-dark));
  --scrollbar-thumb: light-dark(var(--scrollbar-thumb-light), var(--scrollbar-thumb-dark));
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

/* CSS Reset & Defaults */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
  accent-color: var(--primary);
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, textarea {
  font-family: inherit;
  color: inherit;
}

/* Typography Scale */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

/* Utility Containers */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section-alt {
  background-color: var(--bg-alt);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}

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

/* Section Headers */
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 56px auto;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 8px;
}

.section-title {
  font-size: 36px;
  color: light-dark(#000000, #ffffff);
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-muted);
}

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background-color: var(--primary);
  color: light-dark(#ffffff, #090d16);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(45, 212, 191, 0.2);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  background-color: var(--bg-alt);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.btn-text:hover {
  text-decoration: underline;
}

.btn-block {
  width: 100%;
}

/* Header & Sticky Nav */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: transparent;
  border-bottom: 1px solid transparent;
  transition: all var(--transition-normal);
}

.header.scrolled {
  background-color: var(--header-bg);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: padding var(--transition-normal);
}

.header.scrolled .header-container {
  padding: 12px 24px;
}

.logo {
  display: flex;
  flex-direction: column;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary);
  line-height: 1;
}

.logo-sub {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-list {
  display: none;
  list-style: none;
  gap: 32px;
  align-items: center;
}

@media (min-width: 992px) {
  .nav-list {
    display: flex;
  }
}

.nav-link {
  font-weight: 500;
  font-size: 15px;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-fast);
}

.nav-link:hover::after, .nav-link.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-btn {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
}

.nav-btn:hover {
  background-color: var(--primary);
  color: light-dark(#ffffff, #090d16) !important;
  border-color: var(--primary);
}

.nav-btn::after {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background-color: var(--bg-alt);
  border-color: var(--text-muted);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

/* Light/Dark Toggle Visibility */
.moon-icon {
  display: none;
}

:root[data-theme="dark"] .sun-icon {
  display: none;
}

:root[data-theme="dark"] .moon-icon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sun-icon {
    display: none;
  }
  :root:not([data-theme="light"]) .moon-icon {
    display: block;
  }
}

/* Mobile Menu Button */
.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@media (min-width: 992px) {
  .menu-toggle {
    display: none;
  }
}

.menu-toggle span {
  width: 100%;
  height: 2px;
  background-color: var(--text);
  transition: all var(--transition-fast);
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Mobile Navigation Dropdown */
.nav-mobile {
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 24px;
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateY(-150%);
  transition: transform var(--transition-normal);
  box-shadow: var(--shadow-md);
}

.nav-mobile.open {
  transform: translateY(0);
}

.nav-mobile a {
  font-size: 18px;
  font-weight: 600;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.nav-mobile a:last-child {
  border-bottom: none;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 120px;
  padding-bottom: 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 70% 30%, transparent, var(--bg) 80%);
  z-index: -1;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}

@media (min-width: 992px) {
  .hero-content {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.hero-text {
  max-width: 650px;
}

.hero-tag {
  display: inline-block;
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  background-color: light-dark(rgba(15, 118, 110, 0.1), rgba(45, 212, 191, 0.15));
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero-title {
  font-size: 42px;
  line-height: 1.1;
  margin-bottom: 24px;
  color: light-dark(#0f172a, #ffffff);
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 54px;
  }
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  margin-bottom: 40px;
  font-weight: 400;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

/* Hero Visual Media Grid */
.hero-visual {
  display: flex;
  justify-content: center;
  position: relative;
}

.visual-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 420px;
}

.grid-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  aspect-ratio: 4/3;
  background-color: #090d16;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform var(--transition-slow);
}

.grid-item:hover img {
  transform: scale(1.05);
}

.grid-label {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background-color: rgba(9, 13, 22, 0.7);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-align: center;
}

.item-1 {
  transform: translateY(-20px);
}

.item-2 {
  transform: translateY(20px);
}

/* Features (Co nas wyróżnia) */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  padding: 40px 32px;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background-color: var(--primary);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform var(--transition-fast);
}

.feature-card:hover::before {
  transform: scaleY(1);
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background-color: light-dark(rgba(15, 118, 110, 0.08), rgba(45, 212, 191, 0.1));
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.feature-icon svg {
  width: 28px;
  height: 28px;
}

.feature-card h3 {
  font-size: 20px;
  margin-bottom: 16px;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 15px;
}

/* Lectors (W cztery oczy) */
.lectors-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

@media (min-width: 992px) {
  .lectors-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.lector-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
}

.lector-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.lector-img-wrapper {
  position: relative;
  aspect-ratio: 4/5; /* matches 240x300 photos perfectly! */
  overflow: hidden;
}

.lector-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top; /* ensures head is not cropped */
  transition: transform var(--transition-slow);
}

.lector-card:hover .lector-img {
  transform: scale(1.05);
}

@media (min-width: 768px) {
  .lector-card {
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-rows: auto 1fr;
    align-items: start;
  }
  
  .lector-img-wrapper {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    height: 100%;
    aspect-ratio: auto; /* overrides aspect-ratio to let grid determine height */
  }
  
  .lector-info {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    padding: 24px 32px 16px 32px;
  }
  
  .lector-bio-collapse {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
  }
}

.lector-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background-color: var(--accent);
  color: light-dark(#ffffff, #090d16);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
}

.lector-info {
  padding: 32px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.lector-info h3 {
  font-size: 24px;
  margin-bottom: 6px;
}

.lector-role {
  font-size: 14px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lector-snippet {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 24px;
  flex-grow: 1;
}

.lector-bio-collapse {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal);
  background-color: var(--bg-alt);
  border-top: 1px solid var(--border);
}

.lector-bio-collapse.open {
  max-height: 800px; /* arbitrary large value */
}

.bio-inner {
  padding: 32px;
  font-size: 15px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Method (Metoda) */
.method-text {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.method-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: var(--radius-md);
  margin-top: 16px;
}

.method-box h4 {
  font-size: 18px;
  color: var(--primary);
  margin-bottom: 8px;
}

.method-box p {
  font-size: 14px;
  color: var(--text-muted);
}

.styled-image {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  object-fit: cover;
  aspect-ratio: 4/3;
}

/* Courses (Oferta) */
.courses-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 640px) {
  .courses-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .courses-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.course-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.course-img-holder {
  aspect-ratio: 16/10;
  overflow: hidden;
}

.course-img-holder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.course-card:hover .course-img-holder img {
  transform: scale(1.05);
}

.course-info {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.course-info h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

.course-info p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
  flex-grow: 1;
}

.course-more {
  font-weight: 600;
  font-size: 13px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: auto;
}

/* Accordion (Ciekawostki) */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.accordion-item {
  border: 1px solid var(--border);
  background-color: var(--bg-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.accordion-header {
  width: 100%;
  background: none;
  border: none;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: background-color var(--transition-fast);
}

.accordion-header:hover {
  background-color: var(--bg-alt);
}

.accordion-arrow {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.accordion-header[aria-expanded="true"] .accordion-arrow {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal) ease-out;
  border-top: 1px solid transparent;
}

.accordion-header[aria-expanded="true"] + .accordion-content {
  border-color: var(--border);
}

.accordion-content p {
  padding: 20px 24px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Contact Section (Kontakt) */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}

@media (min-width: 992px) {
  .contact-grid {
    grid-template-columns: 0.8fr 1.2fr;
  }
}

.contact-info-cards {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.info-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.info-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.info-card-header h4 {
  font-size: 18px;
}

.info-card-header span {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

.info-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-link {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 500;
}

.info-link svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.info-link:hover {
  color: var(--primary);
}

/* Contact Form */
.contact-form-wrapper {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.form-group label {
  font-size: 14px;
  font-weight: 600;
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--bg);
  outline: none;
  transition: all var(--transition-fast);
}

.form-group input:focus, .form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px light-dark(rgba(15, 118, 110, 0.1), rgba(45, 212, 191, 0.15));
}

.form-group input.invalid, .form-group textarea.invalid {
  border-color: #ef4444; /* Red 500 */
}

/* Native CSS style validation support */
.form-group input:focus:invalid, .form-group textarea:focus:invalid {
  border-color: #f87171;
}

.error-msg {
  display: none;
  font-size: 12px;
  color: #ef4444;
  margin-top: 4px;
}

.form-group input.invalid + .error-msg, .form-group textarea.invalid + .error-msg {
  display: block;
}

.form-status {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  display: none;
  text-align: center;
}

.form-status.success {
  display: block;
  background-color: rgba(16, 185, 129, 0.1); /* Emerald 10 */
  color: #059669; /* Emerald 600 */
  border: 1px solid #10b981;
}

.form-status.error {
  display: block;
  background-color: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid #ef4444;
}

/* Footer */
.footer {
  background-color: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-copyright {
  font-size: 14px;
  color: var(--text);
}

.footer-credit {
  font-size: 12px;
  color: var(--text-muted);
}

/* Scroll Entry/Exit Effects (Modern CSS Support) */
@media (prefers-reduced-motion: no-preference) {
  /* Scroll-reveal system utilizing JS IntersectionObserver fallback */
  .scroll-reveal {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  .scroll-reveal.active {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Dialog Modal Styling (Implementing top-layer animations) */
dialog {
  margin: auto;
  border: 1px solid var(--border);
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  width: 600px;
  padding: 0;
  outline: none;
  overflow: hidden;
}

dialog::backdrop {
  background-color: rgba(9, 13, 22, 0.6);
  backdrop-filter: blur(8px);
}

/* 1. Visible (open) state */
dialog[open] {
  opacity: 1;
  transform: scale(1);
  display: flex; /* Ensure layout works */

  /* 2. Define the starting state for entry (must come after open state) */
  @starting-style {
    opacity: 0;
    transform: scale(0.92);
  }
}

/* 3. Base/Exit states */
dialog {
  opacity: 0;
  transform: scale(0.92);

  /* Mandatory transitions for discrete display & overlay toggling */
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.35s;
  transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); /* slight bounce */
  transition-behavior: allow-discrete;
}

dialog::backdrop {
  opacity: 0;
  transition-property: opacity, display, overlay;
  transition-duration: 0.35s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

dialog[open]::backdrop {
  opacity: 1;
  
  @starting-style {
    opacity: 0;
  }
}

/* Dialog Content Inner Layout */
.dialog-content {
  position: relative;
  width: 100%;
}

.dialog-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-alt);
  border: 1px solid var(--border);
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
}

.dialog-close:hover {
  background-color: var(--border);
  transform: rotate(90deg);
}

.dialog-body {
  padding: 40px;
}

.dialog-body h2 {
  font-size: 32px;
  margin-bottom: 24px;
  color: var(--primary);
}

.dialog-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.dialog-text {
  font-size: 15px;
  color: var(--text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 12px;
}

/* Custom styles for inner dialog scrollbar */
.dialog-text::-webkit-scrollbar {
  width: 6px;
}

.dialog-text::-webkit-scrollbar-track {
  background-color: var(--bg-alt);
}

.dialog-text::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 100px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
}

/* --- Logo Styles --- */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-img {
  height: 48px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  transition: filter var(--transition-normal);
}

.header.scrolled .logo-img {
  height: 40px;
}

/* Dark mode logo filter */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-img {
    filter: invert(1) hue-rotate(180deg);
  }
}

:root[data-theme="dark"] .logo-img {
  filter: invert(1) hue-rotate(180deg);
}

/* --- Checkbox Consent Styles --- */
.checkbox-group {
  margin-top: 8px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-muted);
  user-select: none;
  line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.consent-link {
  color: var(--primary);
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.consent-link:hover {
  color: var(--accent);
}

/* --- Quiz Styles --- */
.quiz-container {
  max-width: 800px;
  margin: 0 auto;
  min-height: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.quiz-screen {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(10px);
}

.quiz-screen.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Start screen */
.quiz-welcome-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.welcome-icon {
  width: 80px;
  height: 80px;
  background-color: rgba(45, 212, 191, 0.1);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.welcome-icon svg {
  width: 44px;
  height: 44px;
}

.quiz-welcome-card h3 {
  font-size: 26px;
  font-family: var(--font-heading);
  color: var(--text);
}

.quiz-welcome-card p {
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 600px;
  font-size: 15px;
}

/* Question card */
.quiz-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.quiz-progress-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.quiz-progress-bar {
  width: 100%;
  height: 6px;
  background-color: var(--border);
  border-radius: 100px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  width: 0%;
  border-radius: 100px;
  transition: width 0.3s ease;
}

.quiz-question {
  font-size: 20px;
  font-family: var(--font-heading);
  color: var(--text);
  margin-bottom: 24px;
  line-height: 1.4;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 768px) {
  .quiz-options {
    grid-template-columns: 1fr 1fr;
  }
}

.option-btn {
  background-color: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  text-align: left;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.option-btn:hover {
  background-color: var(--bg-card);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.option-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.option-btn:hover .option-letter {
  background-color: var(--primary);
  color: white;
}

/* Result screen */
.quiz-result-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.result-badge {
  font-size: 32px;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 16px 32px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.25);
  letter-spacing: 0.05em;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

.quiz-result-card h3 {
  font-size: 24px;
  font-family: var(--font-heading);
  color: var(--text);
}

.result-score {
  font-size: 18px;
  color: var(--text);
}

.result-score strong {
  font-size: 22px;
  color: var(--accent);
}

.result-desc {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 550px;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  margin-top: 12px;
}

@media (min-width: 576px) {
  .result-actions {
    flex-direction: row;
    justify-content: center;
    max-width: 100%;
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.regulamin-text {
  max-height: 400px;
}

.regulamin-text h3 {
  font-size: 16px;
  font-weight: 700;
  margin-top: 16px;
  margin-bottom: 8px;
  color: var(--primary);
}

.regulamin-text p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
}


