/* Matematyka Klasa 5 — landing page
   Paleta i typografia przeniesione 1:1 z motywu "storybook" appki
   (frontend/src/style.css, [data-theme="storybook"]) dla spójności marki. */

:root {
  --bg: #fbf2e0;
  --surface: #fffaf0;
  --accent: #8fb28a;      /* szałwiowa zieleń — primary */
  --accent-2: #d98452;    /* ciepły pomarańcz */
  --accent-3: #7ca3b0;    /* przygaszony błękit */
  --text: #3e2c20;
  --text-muted: #5a4634;
  --nav-border: #efddc4;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Quicksand", system-ui, sans-serif;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-btn: 0 4px 0 #ecdcc0;
  --shadow-card: 5px 6px 0 rgba(90, 70, 52, 0.12);
  --max-width: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(#e7d3ab 1px, transparent 1.4px);
  background-size: 18px 18px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .font-display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1em; }

a { color: var(--accent-2); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

img, svg { max-width: 100%; }

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

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.btn-primary {
  background: var(--accent-2);
  color: #fffaf0;
  box-shadow: 0 4px 0 #b96437;
}

.btn-primary:hover { transform: translateY(1px); box-shadow: 0 3px 0 #b96437; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--nav-border);
  box-shadow: var(--shadow-btn);
}

.btn-secondary:hover { transform: translateY(1px); box-shadow: 0 3px 0 #ecdcc0; }

.btn-block { width: 100%; justify-content: center; }

/* ── Header ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 2px solid var(--nav-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  white-space: nowrap;
}

.brand svg { width: 36px; height: 36px; flex-shrink: 0; }

.nav-toggle-input { display: none; }

.nav-toggle-label {
  display: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a:hover { color: var(--accent-2); }

.lang-switch {
  display: flex;
  gap: 6px;
  align-items: center;
}

.lang-switch a {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-muted);
  border: 2px solid transparent;
}

.lang-switch a[aria-current="true"] {
  border-color: var(--nav-border);
  background: var(--bg);
  color: var(--text);
}

.lang-switch a:hover { color: var(--accent-2); }

/* ── Hero ── */

.hero {
  padding: 64px 0 48px;
}

.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
}

.hero-lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 46ch;
}

.hero-audience {
  margin-top: 28px;
  padding: 16px 20px;
  background: var(--surface);
  border: 2px solid var(--nav-border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--text-muted);
}

.hero-audience strong { color: var(--text); }

.hero-cta {
  margin-top: 28px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-mascot {
  display: flex;
  justify-content: center;
}

.hero-mascot svg { width: min(280px, 70vw); height: auto; }

/* ── Section scaffolding ── */

section { padding: 56px 0; }

.section-title {
  text-align: center;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 12px;
}

.section-lede {
  text-align: center;
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0 auto 40px;
}

.card {
  background: var(--surface);
  border: 2px solid var(--nav-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px;
}

/* ── Feature grid ── */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 24px;
}

.feature-card { text-align: left; }

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.feature-card h3 { font-size: 1.15rem; }

.feature-card p { color: var(--text-muted); font-size: 0.95rem; margin: 0; }

/* ── Lesson-card mockup (illustrative, not a real screenshot) ── */

.mockup-lesson-card {
  background: var(--surface);
  border: 2px solid var(--nav-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
  max-width: 380px;
  margin: 0 auto;
}

.mockup-lesson-card .mockup-badge {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--nav-border);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.mockup-lesson-card h4 {
  font-family: var(--font-display);
  margin: 0 0 10px;
}

.mockup-progress {
  height: 10px;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
  margin: 14px 0;
  border: 1px solid var(--nav-border);
}

.mockup-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  width: 65%;
}

.mockup-steps { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; color: var(--text-muted); }
.mockup-steps li { padding: 4px 0; display: flex; gap: 8px; align-items: center; }
.mockup-steps li.done { color: var(--text); }
.mockup-steps li.done::before { content: "✔"; color: var(--accent); }
.mockup-steps li.active::before { content: "▸"; color: var(--accent-2); }
.mockup-steps li:not(.done):not(.active)::before { content: "○"; opacity: 0.4; }

/* ── Assistant section ── */

.assistant-section {
  background: var(--surface);
  border-top: 2px solid var(--nav-border);
  border-bottom: 2px solid var(--nav-border);
}

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

.assistant-copy h2 { text-align: left; }

.assistant-badge {
  display: inline-block;
  background: var(--accent);
  color: #fffaf0;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.chat-mockup {
  background: var(--bg);
  border: 2px solid var(--nav-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.chat-bubble.student {
  align-self: flex-end;
  background: var(--accent-3);
  color: #fffaf0;
  border-bottom-right-radius: 4px;
}

.chat-bubble.assistant {
  align-self: flex-start;
  background: var(--surface);
  border: 2px solid var(--nav-border);
  border-bottom-left-radius: 4px;
}

.chat-caption {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 10px;
}

/* ── Cost comparison ── */

.compare-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
  max-width: 760px;
  margin: 0 auto;
}

.compare-card {
  text-align: center;
  padding: 32px 20px;
}

.compare-card .compare-price {
  font-family: var(--font-display);
  font-size: 2.2rem;
  margin: 8px 0;
}

.compare-vs {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text-muted);
  text-align: center;
}

.compare-card.tutoring .compare-price { color: var(--text-muted); }
.compare-card.app .compare-price { color: var(--accent-2); }
.compare-card.app { border-color: var(--accent-2); }

/* ── Video placeholder ── */

.video-placeholder {
  max-width: 720px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--accent-3), var(--accent));
  border-radius: var(--radius-lg);
  border: 2px solid var(--nav-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fffaf0;
  text-align: center;
  position: relative;
}

.video-play-icon {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 250, 240, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--accent-2);
}

.video-soon-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}

/* ── Pricing ── */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.price-card {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.price-card.highlight {
  border-color: var(--accent-2);
  position: relative;
}

.price-card-badge {
  align-self: center;
  background: var(--accent-2);
  color: #fffaf0;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.price-card h3 { font-size: 1.1rem; margin-bottom: 4px; }

.price-amount {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--text);
  margin: 8px 0 0;
}

.price-period { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }

.price-savings {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 16px;
}

.price-features {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  text-align: left;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-grow: 1;
}

.price-features li {
  padding: 6px 0;
  display: flex;
  gap: 8px;
}

.price-features li::before { content: "✔"; color: var(--accent); }

.price-features li.excluded { opacity: 0.6; }
.price-features li.excluded::before { content: "✕"; color: var(--text-muted); }

.price-card.free .price-amount { color: var(--accent-3); }

/* ── FAQ ── */

.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }

.faq-item {
  background: var(--surface);
  border: 2px solid var(--nav-border);
  border-radius: var(--radius);
  padding: 4px 20px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  padding: 16px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "+";
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--accent-2);
  flex-shrink: 0;
}

.faq-item[open] summary::after { content: "\2212"; }

.faq-item p { color: var(--text-muted); padding-bottom: 16px; margin: 0; }

/* ── Final CTA ── */

.final-cta {
  text-align: center;
  background: var(--accent);
  color: #fffaf0;
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  margin: 0 20px;
}

.final-cta h2 { color: #fffaf0; }

.final-cta .btn-primary {
  background: #fffaf0;
  color: var(--text);
  box-shadow: 0 4px 0 rgba(62, 44, 32, 0.25);
}

/* ── Footer ── */

.site-footer {
  border-top: 2px solid var(--nav-border);
  padding: 32px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer-links { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent-2); }

/* ── Contact page ── */

.contact-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: start;
}

.contact-aside p { color: var(--text-muted); font-size: 0.95rem; }

.contact-aside ul {
  margin: 0;
  padding-left: 1.1em;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.contact-aside li { margin-bottom: 8px; }

.field { margin-bottom: 20px; }

.field label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--nav-border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.field textarea { resize: vertical; min-height: 140px; }

.field input:focus,
.field textarea:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--accent-3);
}

.field input.is-invalid,
.field textarea.is-invalid { border-color: #c0553a; }

.field-error {
  color: #c0553a;
  font-size: 0.85rem;
  margin-top: 6px;
}

/* Pole na wynik działania — wąskie, bo odpowiedź to zawsze kilka cyfr. */
.captcha-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.captcha-row input { width: 120px; }

#captcha-question {
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.form-error {
  background: #fbeae5;
  border: 2px solid #e7b5a5;
  color: #8f3d26;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.form-success {
  text-align: center;
  padding: 12px 0;
}

.form-success .form-success-mark {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 8px;
}

.form-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 16px 0 0;
}

/* Bez JS formularz nie wyśle się nigdzie (żądanie idzie fetch-em), więc zamiast
   martwych pól pokazujemy adres e-mail. Skrypt chowa ten blok i odsłania formularz. */
.no-js-fallback { margin-bottom: 24px; }

/* ── Responsive ── */

@media (max-width: 860px) {
  .contact-layout { grid-template-columns: 1fr; }

  .hero .container { grid-template-columns: 1fr; }
  .hero-mascot { order: -1; }
  .assistant-grid { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .compare-vs { padding: 4px 0; }
}

@media (max-width: 720px) {
  .nav-toggle-label { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 2px solid var(--nav-border);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px 20px;
    gap: 14px;
  }
  .nav-toggle-input:checked ~ .site-nav { display: flex; }
  .site-header { position: relative; }
  .lang-switch { margin-top: 6px; }
}
