/* ==========================================================================
   1. Definicje zmiennych i motywów (jasny/ciemny)
   ========================================================================== */

:root {
  /* Paleta Kolorów - Motyw Jasny */
  --color-background: #f8f9fa;
  --color-surface: #ffffff;
  --color-primary: #0057ff;
  --color-primary-hover: #0048d6;
  --color-secondary: #e9ecef;
  --color-text-primary: #212529;
  --color-text-secondary: #6c757d;
  --color-border: #dee2e6;
  --color-success: #198754;
  --color-success-background: #e8f5e9;

  /* Typografia */
  --font-family-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-family-serif: "Georgia", "Times New Roman", serif;
  --font-size-base: 16px;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  /* Skalowanie typografii */
  --font-size-h1: clamp(2.5rem, 5vw + 1rem, 4.5rem);
  --font-size-h2: clamp(2rem, 4vw + 0.8rem, 3rem);
  --font-size-h3: clamp(1.5rem, 3vw + 0.5rem, 2rem);
  --font-size-h4: 1.25rem;
  --font-size-p: 1.125rem;
  --font-size-small: 0.875rem;

  /* Odstępy */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 3rem;
  --spacing-section: 6rem;

  /* Inne */
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 16px;
  --box-shadow-light: 0 4px 12px rgba(0, 0, 0, 0.05);
  --box-shadow-medium: 0 8px 24px rgba(0, 0, 0, 0.1);
  --transition-fast: 0.15s ease-in-out;
  --transition-smooth: 0.3s ease-in-out;
  --max-width-container: 1200px;
  --max-width-small-container: 800px;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Paleta Kolorów - Motyw Ciemny */
    --color-background: #121212;
    --color-surface: #1e1e1e;
    --color-primary: #4a90e2;
    --color-primary-hover: #63a2f2;
    --color-secondary: #2c2c2c;
    --color-text-primary: #eaeaea;
    --color-text-secondary: #a0a0a0;
    --color-border: #3a3a3a;
    --color-success: #4caf50;
    --color-success-background: #2e3c30;

    --box-shadow-light: 0 4px 12px rgba(0, 0, 0, 0.2);
    --box-shadow-medium: 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

/* ==========================================================================
   2. Reset i podstawowe style
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family-sans);
  font-weight: var(--font-weight-normal);
  line-height: 1.7;
  color: var(--color-text-primary);
  background-color: var(--color-background);
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
}

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

a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
  margin-bottom: var(--spacing-lg);
  color: var(--color-text-primary);
  font-family: var(--font-family-sans);
}

h1 {
  font-size: var(--font-size-h1);
}
h2 {
  font-size: var(--font-size-h2);
}
h3 {
  font-size: var(--font-size-h3);
}
h4 {
  font-size: var(--font-size-h4);
}

p {
  font-size: var(--font-size-p);
  margin-bottom: var(--spacing-md);
  max-width: 75ch;
  color: var(--color-text-secondary);
}

ul,
ol {
  padding-left: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
}

li {
  font-size: var(--font-size-p);
  margin-bottom: var(--spacing-sm);
  color: var(--color-text-secondary);
}

hr.section-divider {
  border: 0;
  height: 1px;
  background-color: var(--color-border);
  margin: var(--spacing-section) auto;
  width: 80%;
}

/* ==========================================================================
   3. Klasy pomocnicze i layout
   ========================================================================== */

.container {
  width: 90%;
  max-width: var(--max-width-container);
  margin-left: auto;
  margin-right: auto;
}

.small-container {
  width: 90%;
  max-width: var(--max-width-small-container);
  margin-left: auto;
  margin-right: auto;
}

.section-padding {
  padding-top: var(--spacing-section);
  padding-bottom: var(--spacing-section);
}

.section-padding-large {
  padding-top: calc(var(--spacing-section) * 1.5);
  padding-bottom: calc(var(--spacing-section) * 1.5);
}

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

.text-center p,
.text-center h2,
.text-center h3 {
  margin-left: auto;
  margin-right: auto;
}

.light-background {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.section-title {
  margin-bottom: var(--spacing-sm);
}

.section-subtitle {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  max-width: 60ch;
  margin-bottom: var(--spacing-xxl);
}

.icon {
  stroke-width: 1.5;
  color: var(--color-primary);
}

/* ==========================================================================
   4. Przyciski (Buttons)
   ========================================================================== */

.button {
  display: inline-block;
  padding: var(--spacing-md) var(--spacing-xl);
  font-size: var(--font-size-p);
  font-weight: var(--font-weight-medium);
  text-align: center;
  border: 1px solid transparent;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all var(--transition-smooth);
  text-decoration: none;
  user-select: none;
}

.button:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-medium);
}

.button.primary-button {
  background-color: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.button.primary-button:hover {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: white;
}

.button.large-button {
  padding: var(--spacing-lg) var(--spacing-xxl);
  font-size: 1.25rem;
}

.button .icon {
  display: inline-block;
  vertical-align: middle;
  margin-right: var(--spacing-sm);
  width: 20px;
  height: 20px;
  color: white;
}

/* ==========================================================================
   5. Nagłówek i Nawigacja
   ========================================================================== */

.main-header {
  padding: var(--spacing-lg) 0;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow var(--transition-smooth);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  color: var(--color-primary);
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: var(--spacing-xl);
  padding: 0;
  margin: 0;
}

.main-nav a {
  font-size: var(--font-size-p);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  text-decoration: none;
  position: relative;
  padding: var(--spacing-sm) 0;
}

.main-nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  transition: width var(--transition-smooth);
}

.main-nav a:hover,
.main-nav a:focus {
  color: var(--color-text-primary);
}

.main-nav a:hover::after {
  width: 100%;
}

/* ==========================================================================
   6. Sekcja Hero
   ========================================================================== */

.hero-section {
  padding: calc(var(--spacing-section) * 1.5) 0;
  text-align: center;
}

.hero-section h1 {
  margin-bottom: var(--spacing-lg);
}

.hero-section .subtitle {
  font-size: 1.5rem;
  max-width: 65ch;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--spacing-xxl);
  color: var(--color-text-secondary);
}

.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
}

.hero-cta .cta-info {
  font-size: var(--font-size-small);
  color: var(--color-text-secondary);
}

/* ==========================================================================
   7. Sekcja Wprowadzająca
   ========================================================================== */

.intro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-xl);
  margin-top: var(--spacing-xxl);
}

.intro-card {
  background-color: var(--color-surface);
  padding: var(--spacing-xl);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--color-border);
  text-align: left;
  transition: transform var(--transition-smooth),
    box-shadow var(--transition-smooth);
}

.intro-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--box-shadow-medium);
}

.intro-card .icon {
  margin-bottom: var(--spacing-lg);
}

.intro-card h3 {
  margin-bottom: var(--spacing-sm);
  font-size: 1.35rem;
}

.intro-card p {
  font-size: 1rem;
}

/* ==========================================================================
   8. Sekcja z Tabami
   ========================================================================== */

.tabs-wrapper {
  margin-top: var(--spacing-xxl);
}

.tab-buttons {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--spacing-xl);
}

.tab-button {
  padding: var(--spacing-md) var(--spacing-xl);
  font-size: 1.1rem;
  font-weight: var(--font-weight-medium);
  border: none;
  background-color: transparent;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all var(--transition-smooth);
  color: var(--color-text-secondary);
}

.tab-button:hover {
  background-color: var(--color-secondary);
  color: var(--color-text-primary);
}

.tab-button.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-content {
  display: none;
  animation: fadeIn 0.5s ease;
}

.tab-content.active {
  display: block;
}

.tab-content h3 {
  margin-bottom: var(--spacing-lg);
}

.tab-content p,
.tab-content ul,
.tab-content ol {
  max-width: 80ch;
  margin-left: auto;
  margin-right: auto;
}

.tab-content ul li,
.tab-content ol li {
  line-height: 1.8;
}

/* ==========================================================================
   9. Sekcja z Ćwiczeniem
   ========================================================================== */

.exercise-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xxl);
  align-items: center;
}

.exercise-image img {
  border-radius: var(--border-radius-lg);
  box-shadow: var(--box-shadow-medium);
}

.exercise-content .section-title {
  text-align: left;
}

.steps {
  margin-top: var(--spacing-xl);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

.step {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-lg);
}

.step-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background-color: var(--color-secondary);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.step-icon .icon {
  width: 24px;
  height: 24px;
}

.step-text h3 {
  font-size: 1.3rem;
  margin-bottom: var(--spacing-xs);
}

.step-text p {
  font-size: 1rem;
  margin: 0;
}

/* ==========================================================================
   10. Sekcja "Dlaczego komplikujemy"
   ========================================================================== */

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-xl);
}

.content-block {
  background-color: var(--color-surface);
  padding: var(--spacing-xl);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--color-border);
}

.content-block h4 {
  color: var(--color-primary);
  margin-bottom: var(--spacing-md);
}

/* ==========================================================================
   11. Sekcja Pobierania PDF
   ========================================================================== */

.pdf-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-xxl);
  align-items: center;
}

.pdf-content ul {
  list-style: none;
  padding-left: 0;
}

.pdf-content ul li {
  padding-left: 2rem;
  position: relative;
}

.pdf-content ul li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: var(--color-success);
  font-weight: bold;
}

.pdf-content .button {
  margin-top: var(--spacing-lg);
}

.pdf-image img {
  border-radius: var(--border-radius-md);
  box-shadow: var(--box-shadow-light);
  border: 1px solid var(--color-border);
  transition: transform var(--transition-smooth);
}

.pdf-image img:hover {
  transform: scale(1.03);
}

/* ==========================================================================
   12. Sekcja z Opiniami
   ========================================================================== */

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--spacing-xl);
}

.testimonial-card {
  background-color: var(--color-surface);
  padding: var(--spacing-xl);
  border-radius: var(--border-radius-lg);
  border-left: 4px solid var(--color-primary);
  box-shadow: var(--box-shadow-light);
  display: flex;
  flex-direction: column;
}

.testimonial-card blockquote {
  flex-grow: 1;
  border: none;
  padding: 0;
  margin: 0;
}

.testimonial-card blockquote p {
  font-family: var(--font-family-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--color-text-primary);
}

.testimonial-card figcaption {
  margin-top: var(--spacing-md);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
}

/* ==========================================================================
   13. Sekcja FAQ (Akordeon)
   ========================================================================== */

.accordion {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.accordion-item {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: var(--spacing-lg);
  font-size: 1.2rem;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  background-color: transparent;
  border: none;
  text-align: left;
  color: var(--color-text-primary);
  list-style: none; /* Ukrycie domyślnej strzałki */
}

.accordion-header::-webkit-details-marker {
  display: none;
}

.accordion-header .icon {
  transition: transform var(--transition-smooth);
  color: var(--color-text-secondary);
}

.accordion-item[open] .accordion-header .icon {
  transform: rotate(180deg);
}

.accordion-item[open] .accordion-header {
  color: var(--color-primary);
}

.accordion-content {
  padding: 0 var(--spacing-lg) var(--spacing-lg);
  animation: fadeIn 0.4s ease-out;
}

.faq-more-link {
  margin-top: var(--spacing-xl);
  text-align: center;
}

/* ==========================================================================
   14. Sekcja Subskrypcji
   ========================================================================== */
.subscription-section {
  background-color: var(--color-surface);
}

.subscription-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--spacing-lg);
}

.subscription-form {
  margin-top: var(--spacing-xl);
}

.subscription-form .form-group {
  display: flex;
  gap: var(--spacing-sm);
  max-width: 500px;
  margin: 0 auto;
}

.subscription-form input[type="email"] {
  flex-grow: 1;
  padding: var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  background-color: var(--color-background);
  color: var(--color-text-primary);
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.subscription-form input[type="email"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 87, 255, 0.2);
}

.subscription-form .button {
  flex-shrink: 0;
}

.form-privacy {
  margin-top: var(--spacing-md);
  font-size: var(--font-size-small);
}

.form-success-message {
  margin-top: var(--spacing-xl);
  padding: var(--spacing-lg);
  background-color: var(--color-success-background);
  border: 1px solid var(--color-success);
  border-radius: var(--border-radius-md);
  color: var(--color-success);
}

.form-success-message h3 {
  color: inherit;
}

/* ==========================================================================
   15. Stopka
   ========================================================================== */

.main-footer {
  background-color: var(--color-surface);
  color: var(--color-text-secondary);
  padding: var(--spacing-xxl) 0;
  border-top: 1px solid var(--color-border);
  font-size: var(--font-size-p);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xxl);
}

.footer-column h4 {
  font-size: 1.1rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-lg);
}

.footer-column.about-column p {
  font-size: 1rem;
}

.footer-column ul {
  list-style: none;
  padding: 0;
}

.footer-column li {
  margin-bottom: var(--spacing-sm);
}

.footer-column a {
  color: var(--color-text-secondary);
}

.footer-column a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.footer-column address {
  font-style: normal;
  line-height: 1.8;
}

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: var(--spacing-xl);
  text-align: center;
  font-size: var(--font-size-small);
}

/* ==========================================================================
   16. Baner Cookies
   ========================================================================== */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  padding: var(--spacing-lg);
  z-index: 2000;
  box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
  border-top: 1px solid var(--color-border);
  transform: translateY(100%);
  transition: transform var(--transition-smooth);
  display: none; /* Domyślnie ukryty, pokazywany przez JS */
}

.cookie-banner.visible {
  transform: translateY(0);
  display: block;
}

.cookie-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-lg);
}

.cookie-text {
  margin: 0;
  font-size: 1rem;
}

.cookie-button {
  flex-shrink: 0;
  background-color: var(--color-primary);
  color: white;
}

/* ==========================================================================
   17. Animacje i stany
   ========================================================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   18. Adaptacyjność (Media Queries)
   ========================================================================== */

@media (max-width: 1024px) {
  :root {
    --spacing-section: 4rem;
  }

  .exercise-container,
  .pdf-container {
    grid-template-columns: 1fr;
  }

  .exercise-image {
    order: -1;
    max-width: 500px;
    margin: 0 auto;
  }

  .pdf-image {
    max-width: 400px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .header-container {
    position: relative;
  }

  .main-nav {
    display: none; /* Domyślnie ukryte, do obsługi przez JS */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: var(--spacing-lg);
  }

  .main-nav.is-open {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    align-items: center;
  }

  /* Tutaj należałoby dodać przycisk hamburgera */
  /* .mobile-menu-toggle { display: block; } */

  .hero-section .subtitle {
    font-size: 1.25rem;
  }

  .tab-buttons {
    flex-wrap: wrap;
  }

  .footer-grid {
    text-align: center;
  }

  .cookie-container {
    flex-direction: column;
    text-align: center;
    gap: var(--spacing-md);
  }
}

@media (max-width: 480px) {
  :root {
    --font-size-p: 1rem;
  }

  .button.large-button {
    width: 100%;
  }

  .subscription-form .form-group {
    flex-direction: column;
  }
}
