/* ==========================================================================
   avvizo.dev — style wspólne dla wszystkich podstron
   ========================================================================== */

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* --- Tokeny motywu --- */
:root {
  --bg-primary: #0a0a0b;
  --bg-secondary: #111113;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-bg-hover: rgba(255, 255, 255, 0.05);
  --text-primary: #ededed;
  --text-secondary: #888888;
  --text-muted: #808080;
  --accent: #ffffff;
  --accent-dim: rgba(255, 255, 255, 0.12);
  --radius: 20px;
  --radius-sm: 12px;
}

/* Motyw jasny — klasa ustawiana w <head>, zanim powstanie <body> */
html.light {
  --bg-primary: #f5f5f7;
  --bg-secondary: #e8e8ed;
  --glass-bg: rgba(0, 0, 0, 0.03);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-bg-hover: rgba(0, 0, 0, 0.05);
  --text-primary: #1d1d1f;
  --text-secondary: #55555a;
  --text-muted: #646469;
  --accent: #000000;
  --accent-dim: rgba(0, 0, 0, 0.08);
}

/* --- Baza --- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ziarno / szum w tle */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

html.light body::before {
  opacity: 0;
}

/* Poświata w tle */
.ambient-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}

.glow-1 {
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, #ffffff 0%, transparent 70%);
}

.glow-2 {
  bottom: -300px;
  right: -100px;
  background: radial-gradient(circle, #4466ff 0%, transparent 70%);
  opacity: 0.05;
}

html.light .ambient-glow {
  opacity: 0.04;
}

/* --- Loader (tylko gdy JS działa) --- */
.loader {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.js .loader {
  display: flex;
}

.loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-logo {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -1px;
  color: var(--text-primary);
  animation: loaderPulse 1.2s ease-in-out infinite;
}

.loader-logo span {
  color: var(--text-muted);
  font-weight: 400;
}

@keyframes loaderPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

html.light .loader {
  background: #f5f5f7;
}

/* --- Nawigacja --- */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(10, 10, 11, 0.8);
  border-bottom: 1px solid var(--glass-border);
}

html.light nav {
  background: rgba(245, 245, 247, 0.85);
}

.nav-logo {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-logo span {
  color: var(--text-muted);
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 400;
  transition: color 0.2s ease;
  letter-spacing: -0.2px;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-cta {
  padding: 8px 20px;
  background: var(--accent);
  color: var(--bg-primary) !important;
  border-radius: 100px;
  font-weight: 500;
  font-size: 13px;
  transition: opacity 0.2s ease;
}

.nav-cta:hover {
  opacity: 0.85;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 110;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.nav-hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 11, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-overlay.show {
  display: flex;
  opacity: 1;
}

.mobile-overlay a {
  font-size: 24px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  letter-spacing: -0.5px;
}

.mobile-overlay a:hover {
  color: var(--text-primary);
}

.mobile-overlay .nav-cta {
  font-size: 16px;
  padding: 12px 28px;
}

/* Bez JS hamburger nie ma czego otwierać */
.no-js .nav-hamburger {
  display: none;
}

/* --- Przełącznik motywu --- */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--text-primary);
  background: var(--glass-bg-hover);
}

.no-js .theme-toggle {
  display: none;
}

/* --- Sekcje i typografia pomocnicza --- */
section {
  position: relative;
  z-index: 1;
  scroll-margin-top: 80px;
}

.section-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
  letter-spacing: -2px;
  line-height: 1.1;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 500px;
  line-height: 1.7;
  font-weight: 300;
}

/* --- Szkło --- */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

/* --- Przyciski --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s ease;
  letter-spacing: -0.2px;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
}

.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

/* --- Wejście przy przewijaniu (tylko z JS) --- */
.fade-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .fade-in {
  opacity: 0;
  transform: translateY(20px);
}

.js .fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Stopka --- */
footer {
  padding: 40px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

footer p {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a,
.footer-links button {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}

.footer-links a:hover,
.footer-links button:hover {
  color: var(--text-secondary);
}

/* --- Strony prawne --- */
.legal-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 160px 40px 120px;
}

.legal-head {
  margin-bottom: 40px;
}

.legal-updated {
  font-size: 13px;
  color: var(--text-muted);
}

.legal-content {
  padding: 44px 48px;
}

.legal-content h2 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin: 34px 0 12px;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin: 22px 0 8px;
}

.legal-content p,
.legal-content li {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.8;
  font-weight: 300;
}

.legal-content p + p {
  margin-top: 12px;
}

.legal-content ul {
  margin: 10px 0 0 20px;
}

.legal-content li {
  margin-bottom: 6px;
}

.legal-content a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-content a:hover {
  color: var(--text-secondary);
}

.legal-content strong {
  color: var(--text-primary);
  font-weight: 500;
}

.legal-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--text-primary);
  background: var(--accent-dim);
  padding: 2px 6px;
  border-radius: 6px;
}

/* --- Powrót na górę --- */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: rgba(255, 255, 255, 0.1);
}

.no-js .back-to-top {
  display: none;
}

/* --- Pływający WhatsApp --- */
.whatsapp-float {
  display: none;
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  font-size: 26px;
  align-items: center;
  justify-content: center;
  z-index: 50;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
  animation: whatsappPulse 2s ease-in-out infinite;
}

@keyframes whatsappPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3); }
  50% { box-shadow: 0 4px 30px rgba(37, 211, 102, 0.6); }
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 100px;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  font-size: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast i {
  color: #22c55e;
  font-size: 13px;
}

html.light .toast {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
}

/* --- Przejście między podstronami --- */
.page-transition {
  animation: pageIn 0.4s ease-out;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Responsywność wspólna --- */
@media (max-width: 768px) {
  nav {
    padding: 14px 16px;
  }

  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .section-title {
    font-size: 28px;
    letter-spacing: -1.5px;
  }

  .section-desc {
    font-size: 15px;
  }

  footer {
    padding: 24px 20px;
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  footer p {
    font-size: 12px;
  }

  .footer-links {
    gap: 16px;
  }

  .footer-links a,
  .footer-links button {
    font-size: 12px;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }

  .whatsapp-float {
    display: flex;
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    font-size: 24px;
  }

  .back-to-top.whatsapp-shift {
    right: 88px;
  }

  .toast {
    bottom: 24px;
    padding: 12px 20px;
    font-size: 13px;
  }

  .legal-page {
    padding: 100px 20px 60px;
  }

  .legal-head {
    margin-bottom: 28px;
  }

  .legal-content {
    padding: 26px 22px;
  }

  .legal-content h2 {
    font-size: 17px;
    margin-top: 28px;
  }

  .legal-content p,
  .legal-content li {
    font-size: 14px;
  }
}
