/*
 * BotPomocnik Landing Page
 * Warm editorial design for family care product
 * Target: People sponsoring SMS reminders for their close ones
 * Fonts: Crimson Pro (display) + Figtree (body) via Google Fonts
 */

/* ============================================================
   Custom Properties
   ============================================================ */
:root {
  /* Warm palette */
  --cream: #faf7f2;
  --cream-dark: #f2ede5;
  --white: #ffffff;
  --text-primary: #2c2825;
  --text-secondary: #6b6560;
  --text-muted: #8a8480;

  /* Brand */
  --brand: #1a365d;
  --brand-dark: #0f2440;
  --brand-light: #234a7a;
  --amber: #b87333;
  --amber-light: #f5e8d8;
  --green: #2f855a;
  --green-bg: #edf7f0;

  /* Borders & shadows */
  --border: #ddd6ca;
  --border-light: #ebe5db;
  --shadow-sm: 0 1px 3px rgba(44, 40, 37, 0.06);
  --shadow-md: 0 4px 16px rgba(44, 40, 37, 0.08);
  --shadow-lg: 0 8px 32px rgba(44, 40, 37, 0.1);
  --shadow-xl: 0 16px 48px rgba(44, 40, 37, 0.12);

  /* Typography */
  --font-display: 'Crimson Pro', Georgia, 'Times New Roman', serif;
  --font-body: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --section-pad: 5rem;
  --container-max: 720px;
}

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

/* ============================================================
   Base
   ============================================================ */
html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--text-primary);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--text-primary);
  font-weight: 700;
}

h2 {
  font-size: 2.4rem;
  margin: 0 0 2rem;
  text-align: center;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.35rem;
  margin: 1.5rem 0 0.75rem;
}

h4 {
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
}

a {
  color: var(--brand);
  text-decoration-color: var(--amber);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--amber);
}

a:visited {
  color: var(--brand);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  background:
    radial-gradient(ellipse at 70% 30%, rgba(184, 115, 51, 0.1) 0%, transparent 55%),
    linear-gradient(165deg, var(--brand-dark) 0%, var(--brand) 50%, var(--brand-light) 100%);
  color: #fff;
  padding: 5.5rem 0 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero .brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  margin: 0 0 1.25rem;
  opacity: 0.7;
  font-weight: 600;
  animation: hero-enter 0.7s ease both;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 2.6rem;
  margin: 0 auto 1.25rem;
  color: #fff;
  max-width: 600px;
  letter-spacing: -0.02em;
  font-weight: 700;
  animation: hero-enter 0.7s ease 0.1s both;
}

.hero .subtitle {
  font-size: 1.25rem;
  margin: 0 auto 2.5rem;
  opacity: 0.9;
  max-width: 500px;
  animation: hero-enter 0.7s ease 0.2s both;
}

.hero .cta-button {
  animation: hero-enter 0.7s ease 0.35s both;
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   CTA Buttons
   ============================================================ */
.cta-button {
  display: inline-block;
  padding: 1rem 2.5rem;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 600;
  font-family: var(--font-body);
  font-size: 1.1rem;
  min-height: 48px;
  border: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  /* Default: light button on dark backgrounds */
  background: #fff;
  color: var(--brand);
  box-shadow: var(--shadow-md);
}

.cta-button:visited {
  color: var(--brand);
}

.cta-button:hover,
.cta-button:focus {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  color: var(--brand);
}

/* Primary variant: dark button on light backgrounds */
.cta-button--primary {
  background: var(--brand);
  color: #fff;
}

.cta-button--primary:visited {
  color: #fff;
}

.cta-button--primary:hover,
.cta-button--primary:focus {
  background: var(--brand-dark);
  color: #fff;
}

/* ============================================================
   Sections
   ============================================================ */
section {
  padding: var(--section-pad) 0;
}

/* Philosophy section */
.philosophy p {
  color: var(--text-secondary);
}

/* Alternating backgrounds */
.examples,
.philosophy,
#jak-zaczac,
.faq {
  background: var(--cream-dark);
}

/* ============================================================
   Steps (How it works)
   ============================================================ */
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}

.steps li {
  padding: 1.25rem 0 1.25rem 4rem;
  position: relative;
  border-bottom: 1px solid var(--border-light);
}

.steps li:last-child {
  border-bottom: none;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  font-family: var(--font-display);
  box-shadow: var(--shadow-sm);
}

.steps strong {
  font-size: 1.2rem;
  font-family: var(--font-display);
}

.step-detail {
  color: var(--text-secondary);
}

/* ============================================================
   Chat Card (SMS examples wrapper)
   ============================================================ */
.phone-mockup {
  max-width: 440px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 16px;
  padding: 1.5rem 1.5rem 1.5rem;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.03),
    var(--shadow-lg);
}

/* ============================================================
   Chat Bubbles (SMS examples)
   ============================================================ */
.chat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.chat:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.chat-bubble {
  padding: 0.7rem 1rem;
  border-radius: 1.2rem;
  max-width: 85%;
  line-height: 1.5;
  font-size: 0.95rem;
}

.chat-user {
  background: var(--brand);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 0.3rem;
}

.chat-bot {
  background: var(--cream);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 0.3rem;
}

/* ============================================================
   Feature Lists (Close person experience, Sponsor benefits)
   ============================================================ */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  padding: 0.85rem 0 0.85rem 2.25rem;
  position: relative;
  border-bottom: 1px solid var(--border-light);
}

.feature-list li:last-child {
  border-bottom: none;
}

.feature-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--amber);
  font-weight: 700;
  font-size: 1.2rem;
}

/* ============================================================
   Pricing
   ============================================================ */
.pricing {
  text-align: center;
}

/* Single pricing card */
.pricing-plan {
  position: relative;
  max-width: 420px;
  margin: 0 auto 2.5rem;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow-sm);
}


/* Price display inside pricing plan */
.pricing-plan__price {
  margin-bottom: 1.5rem;
}

.price {
  font-size: 2.1rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--brand);
}

.price-period {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-secondary);
  font-family: var(--font-body);
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 auto 2.5rem;
  text-align: left;
  max-width: 400px;
}

.pricing-features li {
  padding: 0.5rem 0 0.5rem 2rem;
  position: relative;
}

.pricing-features li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
  font-size: 1.1rem;
}

.pricing-features li:first-child {
  font-weight: 600;
}

.pricing-features .pricing-highlight {
  background: var(--green-bg);
  margin: 0.25rem -0.85rem;
  padding-left: 2.85rem;
  padding-right: 0.85rem;
  border-radius: 8px;
  border-left: 3px solid var(--green);
}

/* ============================================================
   FAQ
   ============================================================ */
.faq-list {
  margin: 0;
  padding: 0;
}

.faq-list dt {
  font-weight: 700;
  font-size: 1.15rem;
  font-family: var(--font-display);
  margin: 1.75rem 0 0.5rem;
  color: var(--brand);
}

.faq-list dt:first-child {
  margin-top: 0;
}

.faq-list dd {
  margin: 0 0 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.faq-list dd:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

/* ============================================================
   Signup
   ============================================================ */
.signup {
  background:
    radial-gradient(ellipse at 30% 70%, rgba(184, 115, 51, 0.08) 0%, transparent 50%),
    linear-gradient(165deg, var(--brand-dark) 0%, var(--brand) 100%);
  color: #fff;
  text-align: center;
}

.signup h2 {
  color: #fff;
}

.signup p {
  font-size: 1.15rem;
  margin: 0 0 1.5rem;
  opacity: 0.9;
}

.form-container {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-xl);
}

.signup-form {
  text-align: left;
}

.signup-form label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-input {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.12);
}


.form-input--error,
.form-input--error:focus {
  border-color: #c53030;
  box-shadow: 0 0 0 3px rgba(197, 48, 48, 0.12);
}

.field-error {
  color: #c53030;
  font-size: 0.85rem;
  margin: 0.3rem 0 0;
  padding: 0;
}

.form-error {
  color: #c53030;
  background: #fff5f5;
  border: 1px solid #feb2b2;
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.form-submit {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0.9rem;
  border: none;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.form-submit:hover,
.form-submit:focus {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.form-consent {
  text-align: center;
  margin-top: 0.75rem;
  margin-bottom: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.form-consent a {
  color: var(--text-secondary);
  text-decoration: underline;
}

.code-loading {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.form-success {
  text-align: left;
  padding: 1.5rem;
}

.form-success .success-icon {
  margin: 0 0 0.75rem;
}

/* Shared success checkmark icon */
.success-icon {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto 0.75rem;
  background: var(--green-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-icon svg {
  width: 1.4rem;
  height: 1.4rem;
  stroke: var(--green);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Larger variant for standalone pages */
.success-icon--lg {
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1rem;
}

.success-icon--lg svg {
  width: 1.8rem;
  height: 1.8rem;
}

.form-success-heading {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.form-success-steps {
  text-align: left;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.form-success-steps-title {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.75rem;
}

/* Compact steps with CSS-counter numbers for narrow containers */
.steps-compact {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step-compact;
}

.steps-compact li {
  position: relative;
  padding-left: 2.25rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0;
}

.steps-compact li:last-child {
  padding-bottom: 0;
}

.steps-compact li::before {
  counter-increment: step-compact;
  content: counter(step-compact);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  font-family: var(--font-body);
}

.steps-compact strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.5rem;
}

.steps-compact .step-detail {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ============================================================
   Checkout Result Pages (success/cancel)
   ============================================================ */
.checkout-result {
  text-align: left;
}

.checkout-result p {
  font-size: 1.15rem;
  max-width: 500px;
  margin: 0 0 2rem;
}

.trial-info {
  background: var(--green-bg);
  border-left: 3px solid var(--green);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.trial-info strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.trial-date {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--green);
  margin: 0.25rem 0;
}

.checkout-cta {
  margin-top: 2rem;
}

/* ============================================================
   Privacy Policy (collapsible <details>)
   ============================================================ */
.privacy summary {
  cursor: pointer;
  list-style: none;
  text-align: center;
}

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

.privacy summary::marker {
  display: none;
  content: "";
}

.privacy-heading {
  display: inline-block;
  font-size: 1.8rem;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0;
  border-bottom: 2px solid var(--amber);
  padding-bottom: 0.25rem;
  transition: border-color 0.2s ease;
}

.privacy summary:hover .privacy-heading {
  border-color: var(--brand);
}

.privacy summary::after {
  content: "Kliknij aby rozwinąć";
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.privacy details[open] summary::after {
  display: none;
}

.privacy details[open] summary .privacy-heading {
  margin-bottom: 1.5rem;
}

.privacy-updated {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.privacy h3 {
  color: var(--brand);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.5rem;
}

.privacy h4 {
  color: var(--text-secondary);
}

.privacy ul,
.privacy ol {
  padding-left: 1.5rem;
}

.privacy li {
  margin-bottom: 0.4rem;
}

.privacy-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.privacy-table th,
.privacy-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.privacy-table th {
  background: var(--cream-dark);
  font-weight: 700;
  color: var(--brand);
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  padding: 3rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  border-top: 1px solid var(--border-light);
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.footer-links a {
  color: var(--brand);
  text-decoration-color: var(--amber);
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}

.footer-tagline {
  margin: 0.5rem 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.footer-copyright {
  margin: 0.3rem 0;
  font-size: 0.85rem;
}

/* ============================================================
   Scroll Animations (classes added via JS)
   ============================================================ */
.will-animate {
  opacity: 0;
  transform: translateY(24px);
}

.will-animate.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

/* Stagger: steps */
.steps .will-animate:nth-child(2) { transition-delay: 0.1s; }
.steps .will-animate:nth-child(3) { transition-delay: 0.2s; }

/* Stagger: compact steps (waitlist success) */
.steps-compact .will-animate:nth-child(2) { transition-delay: 0.1s; }
.steps-compact .will-animate:nth-child(3) { transition-delay: 0.2s; }

/* Stagger: chat conversations */
.chat.will-animate:nth-child(2) { transition-delay: 0.08s; }
.chat.will-animate:nth-child(3) { transition-delay: 0.16s; }
.chat.will-animate:nth-child(4) { transition-delay: 0.24s; }
.chat.will-animate:nth-child(5) { transition-delay: 0.32s; }
.chat.will-animate:nth-child(6) { transition-delay: 0.40s; }
.chat.will-animate:nth-child(7) { transition-delay: 0.48s; }

/* Stagger: feature lists */
.feature-list .will-animate:nth-child(2) { transition-delay: 0.08s; }
.feature-list .will-animate:nth-child(3) { transition-delay: 0.16s; }
.feature-list .will-animate:nth-child(4) { transition-delay: 0.24s; }
.feature-list .will-animate:nth-child(5) { transition-delay: 0.32s; }
.feature-list .will-animate:nth-child(6) { transition-delay: 0.40s; }
.feature-list .will-animate:nth-child(7) { transition-delay: 0.48s; }

/* ============================================================
   Accessibility
   ============================================================ */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* White outline on dark backgrounds */
.hero a:focus-visible,
.signup a:focus-visible {
  outline-color: #fff;
}

.signup .form-submit:focus-visible {
  outline-color: var(--brand);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .will-animate {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   Responsive — Mobile (< 480px)
   ============================================================ */
@media (max-width: 480px) {
  :root {
    --section-pad: 3.5rem;
  }

  body {
    font-size: 1.0625rem;
  }

  .hero {
    padding: 3.5rem 0 3rem;
  }

  .hero h1 {
    font-size: 1.9rem;
  }

  .hero .subtitle {
    font-size: 1.1rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  .cta-button {
    padding: 0.9rem 2rem;
    font-size: 1.05rem;
  }

  .phone-mockup {
    border-radius: 12px;
    padding: 1rem 1rem 0.25rem;
    margin: 0 -0.25rem;
  }

  .chat-bubble {
    max-width: 90%;
  }

  .pricing-plan {
    padding: 1.25rem 1rem;
    border-radius: 12px;
  }

  .price {
    font-size: 1.75rem;
  }

  .form-container {
    padding: 1.25rem;
    border-radius: 12px;
    margin: 0 -0.25rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.75rem;
  }

  .privacy-table {
    font-size: 0.85rem;
  }

  .privacy-table th,
  .privacy-table td {
    padding: 0.5rem;
  }
}

/* ============================================================
   Responsive — Tablet (481px–768px)
   ============================================================ */
@media (min-width: 481px) and (max-width: 768px) {
  :root {
    --section-pad: 4rem;
  }

  .hero h1 {
    font-size: 2.2rem;
  }
}

/* ============================================================
   Responsive — Desktop (769px+)
   ============================================================ */
@media (min-width: 769px) {
  :root {
    --section-pad: 6rem;
    --container-max: 780px;
  }

  h2 {
    font-size: 2.6rem;
  }

  .hero {
    padding: 6.5rem 0 6rem;
  }

  .hero h1 {
    font-size: 3rem;
  }

  .hero .subtitle {
    font-size: 1.35rem;
  }
}
