/* ==========================================================================
   Landing Page — AlleProfit
   Hero, Features, Pricing, FAQ, Footer
   ========================================================================== */

/* ==========================================================================
   LANDING TOPBAR (transparent override)
   ========================================================================== */

.landing-topbar {
  background: rgba(248, 250, 252, 0.7);
}

[data-theme='dark'] .landing-topbar {
  background: rgba(11, 17, 33, 0.7);
}

/* ==========================================================================
   LANDING TOPBAR — MOBILE (logged-out)
   Logo + compact "Zarejestruj się" + hamburger must fit even on 320px.
   ========================================================================== */

@media (max-width: 768px) {
  .landing-topbar .topbar-inner {
    flex-wrap: nowrap;
    gap: var(--space-xs);
  }

  /* Shrink logo on mobile so there's room for actions */
  .landing-topbar .brand-logo {
    height: 32px !important;
    width: auto;
  }

  /* Hide theme toggle on small screens to free up space */
  .landing-topbar .theme-toggle {
    display: none;
  }

  /* Tighter action group spacing */
  .landing-topbar .topbar-actions {
    gap: var(--space-xs);
  }

  /* Compact "Zarejestruj się" button on narrow viewports */
  .landing-topbar .btn-primary.btn-sm {
    padding: 6px 10px;
    font-size: var(--text-xs);
    white-space: nowrap;
  }
}

/* Very small phones (<=380px) — hide register text, keep only hamburger + short CTA */
@media (max-width: 380px) {
  .landing-topbar .brand-logo {
    height: 28px !important;
  }
  .landing-topbar .btn-primary.btn-sm {
    padding: 5px 8px;
  }
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero {
  position: relative;
  padding: var(--space-5xl) 0 var(--space-4xl);
  overflow: hidden;
  text-align: center;
}

/* Hero particles canvas */
#hero-particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 90, 0, 0.08) 0%,
    rgba(212, 160, 23, 0.05) 40%,
    transparent 70%
  );
  background-size: 200% 200%;
  animation: heroGradientShift 8s ease-in-out infinite;
  pointer-events: none;
}

[data-theme='dark'] .hero::before {
  background: radial-gradient(
    circle,
    rgba(255, 133, 51, 0.12) 0%,
    rgba(232, 184, 48, 0.06) 40%,
    transparent 70%
  );
  background-size: 200% 200%;
  animation: heroGradientShift 8s ease-in-out infinite;
}

/* Subtle grid pattern */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 90, 0, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 90, 0, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: var(--weight-extrabold);
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--color-text);
  margin-bottom: var(--space-lg);
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, #ff5a00 0%, #d4a017 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  max-width: 560px;
  margin: 0 auto var(--space-2xl);
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.hero-cta .btn-primary {
  padding: 0.875rem 2rem;
  font-size: var(--text-base);
  border-radius: var(--radius-md);
}

.hero-cta .btn-secondary {
  padding: 0.875rem 2rem;
  font-size: var(--text-base);
  border-radius: var(--radius-md);
}

/* Trust badges */
.hero-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xl);
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
}

.hero-trust-icons {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-weight: var(--weight-medium);
}

/* Hero line animations — staggered entrance */
/* Hero micro-copy: the trial note lives quietly UNDER the CTA buttons
   (where such reassurances belong), and the speed callout is an editorial
   line with a short orange dash instead of the former pill+emoji capsule
   (de-templating pass 2026-07-04). Copy unchanged. */
.hero-callout {
  max-width: 560px;
  margin: 0 auto var(--space-lg);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.hero-callout::before {
  content: '';
  display: block;
  width: 28px;
  height: 3px;
  background: var(--color-primary);
  margin: 0 auto var(--space-sm);
  border-radius: 2px;
}

.hero-callout b {
  color: var(--color-text);
}

.hero-note {
  margin-top: var(--space-md);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.01em;
}

.hero-line {
  display: inline-block;
  opacity: 0;
  transform: translateY(25px);
  animation: heroLineIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-line-1 {
  animation-delay: 0.1s;
}
.hero-line-2 {
  animation-delay: 0.35s;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-gold, #d4a017) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
}
.hero-line-3 {
  animation-delay: 0.6s;
}

@keyframes heroLineIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 639px) {
  .hero {
    padding: var(--space-3xl) 0 var(--space-2xl);
  }

  .hero-trust {
    flex-direction: column;
    gap: var(--space-md);
  }

  .hero-cta {
    flex-direction: column;
  }

  .hero-cta .btn {
    width: 100%;
  }
}

/* ==========================================================================
   SECTION COMMON
   ========================================================================== */

.section {
  padding: var(--space-5xl) 0;
}

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

.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-3xl);
}

.section-header h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  margin-bottom: var(--space-md);
}

.section-header p {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
}

.section-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-primary);
  margin-bottom: var(--space-md);
}

/* ==========================================================================
   FEATURES SECTION
   ========================================================================== */

/* Ledger — the "seller's settlement" list that replaced the 2x2 icon-card
   grid (2026-07-04): four hairline-separated entries whose left column is a
   number token taken from the copy itself. The arithmetic is the artwork. */
.ledger {
  max-width: 860px;
  margin: 0 auto;
  border-top: 1px solid var(--color-border);
}

.ledger-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-xl);
  align-items: center;
  padding: var(--space-xl) var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.ledger-token {
  font-variant-numeric: tabular-nums;
  border-right: 2px solid var(--color-border);
  padding-right: var(--space-lg);
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.lt-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  font-weight: 600;
}

.lt-line em,
.lt-result em,
.lt-caption {
  font-style: normal;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 400;
  white-space: nowrap;
}

.lt-minus .lt-num {
  color: var(--color-danger, #ef4444);
}

.lt-result {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--color-text);
  font-size: var(--text-lg);
  font-weight: 800;
}

.lt-result .lt-num {
  color: var(--color-primary);
}

.lt-big {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.lt-loss {
  color: var(--color-danger, #ef4444);
}

.lt-plain {
  color: var(--color-text);
}

.ledger-copy h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-xs);
}

.ledger-copy p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  margin: 0;
}

@media (max-width: 639px) {
  .ledger-row {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .ledger-token {
    border-right: none;
    border-left: 2px solid var(--color-border);
    padding-right: 0;
    padding-left: var(--space-md);
    max-width: 260px;
  }
}

/* ==========================================================================
   HOW IT WORKS
   ========================================================================== */

.steps {
  display: grid;
  /* 4 steps since 07/2026 (added "Dodaj koszty zakupu"). */
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
  position: relative;
}

/* Connecting line between steps */
.steps::before {
  content: '';
  position: absolute;
  top: 36px;
  /* 12.5% = the center of the first/last of FOUR equal columns (1/8);
     was 16.67% (1/6) from the three-step era, which left the line
     floating short of circles 1 and 4. */
  left: calc(12.5% + 20px);
  right: calc(12.5% + 20px);
  height: 2px;
  background: var(--color-border);
}

@media (max-width: 639px) {
  .steps {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .steps::before {
    display: none;
  }
}

.step {
  text-align: center;
  position: relative;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-primary-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-lg);
  position: relative;
  z-index: 1;
}

.step h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-sm);
}

.step p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  max-width: 280px;
  margin: 0 auto;
}

/* ==========================================================================
   PRICING SECTION
   ========================================================================== */

.pricing-grid {
  display: grid;
  /* auto-fit zamiast sztywnych 3 kolumn: w aplikacji (sidebar 260px) przy
     1024-1180px trzecia karta wystawała ~135px poza viewport i robiła
     poziomy scroll — teraz siatka łamie się na 2+1, gdy brakuje miejsca. */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
  align-items: stretch;
}

@media (max-width: 1023px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin: 0 auto;
  }

  .pricing-card--featured {
    transform: none;
  }

  .pricing-card--featured:hover {
    transform: translateY(-4px);
  }
}

.pricing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-2xl);
}

.pricing-toggle-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
}

.pricing-toggle-label.active {
  color: var(--color-text);
}

.pricing-save-badge {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-success);
  background: var(--color-success-light);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   FAQ SECTION
   ========================================================================== */

.faq-list {
  max-width: 720px;
  margin: 0 auto;
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
  overflow: hidden;
  background: var(--color-surface);
  transition: box-shadow var(--transition);
}

.faq-item:hover {
  box-shadow: var(--shadow-sm);
}

.faq-question {
  width: 100%;
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  background: none;
  border: none;
}

.faq-question:hover {
  color: var(--color-primary);
}

.faq-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: transform var(--transition);
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height var(--transition-slow),
    padding var(--transition-slow);
}

.faq-item.active .faq-answer {
  max-height: 300px;
}

.faq-answer-inner {
  padding: 0 var(--space-xl) var(--space-lg);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

/* ==========================================================================
   CTA SECTION
   ========================================================================== */

.cta-section {
  padding: var(--space-4xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-primary-light) 0%, transparent 60%);
  pointer-events: none;
}

.cta-content {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
}

.cta-content h2 {
  margin-bottom: var(--space-md);
}

.cta-content p {
  margin-bottom: var(--space-xl);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
  padding: var(--space-3xl) 0 var(--space-xl);
  border-top: 1px solid var(--color-border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

@media (max-width: 639px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
}

.footer-brand {
  max-width: 280px;
}

.footer-brand-name {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.footer-brand-name span {
  color: var(--color-primary);
}

.footer-brand p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

.footer-column h4 {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-lg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--space-sm);
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--color-text);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer-copyright {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.footer-insertnow {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition);
}

.footer-insertnow:hover {
  color: var(--color-primary);
}

.footer-bottom-links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
}

.footer-bottom-links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--transition);
}

.footer-bottom-links a:hover {
  color: var(--color-text);
}

/* ==========================================================================
   TOGGLE SWITCH (for theme and pricing)
   ========================================================================== */

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--color-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--color-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ==========================================================================
   LANGUAGE SWITCHER
   ========================================================================== */

.lang-switcher {
  display: flex;
  align-items: center;
  background: var(--color-surface-hover);
  border-radius: var(--radius-full);
  padding: 2px;
  gap: 2px;
}

.lang-switcher button {
  padding: 0.3rem 0.6rem;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  border-radius: var(--radius-full);
  transition: all var(--transition);
  background: transparent;
  border: none;
  cursor: pointer;
}

.lang-switcher button.active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.lang-switcher button:hover:not(.active) {
  color: var(--color-text-secondary);
}

/* ==========================================================================
   THEME TOGGLE BUTTON
   ========================================================================== */

.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  background: transparent;
  border: none;
}

.theme-toggle:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

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

.theme-toggle .icon-moon,
[data-theme='dark'] .theme-toggle .icon-sun {
  display: none;
}

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

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

.theme-toggle .icon-sun {
  display: block;
}

/* ==========================================================================
   CTA GLOW PULSE
   ========================================================================== */

.hero-cta .btn-primary,
.cta-content .btn-primary {
  position: relative;
  z-index: 1;
  overflow: visible;
}

.hero-cta .btn-primary::after,
.cta-content .btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #ff5a00;
  opacity: 0;
  z-index: -1;
  filter: blur(14px);
  animation: glowPulse 3s ease-in-out infinite;
  pointer-events: none;
}

/* ==========================================================================
   COUNTER ANIMATION STATE
   ========================================================================== */

.hero-stat-value[data-count-target] {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   TRUSTED BY / SOCIAL PROOF
   ========================================================================== */

.social-proof {
  text-align: center;
  padding: var(--space-2xl) 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
