/* Pocki, strona WWW. Kolory i promienie: tokens.css (generowane z design/tokens.json). */

:root {
  color-scheme: light dark;
  accent-color: var(--interactive-primary);
  --max: 1080px;
  --rule: color-mix(in srgb, var(--text-primary) 12%, transparent);
  --paper: #fffdf8;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --bubble-in: #ece8f3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1f1a3a;
    --bubble-in: #2e2850;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-app);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--interactive-primary);
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 3px solid var(--interactive-primary);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 1.3rem + 4.4vw, 4.4rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.8rem, 1.3rem + 1.9vw, 2.6rem);
  font-weight: 800;
}

p {
  margin: 0;
  text-wrap: pretty;
}

.wrap {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  z-index: 10;
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Nagłówek ---------- */

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
}

.logo {
  font-weight: 800;
  font-size: 1.65rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: flex-start;
  gap: 1px;
}

.logo svg {
  width: 15px;
  height: 15px;
  margin-top: 1px;
}

@media (prefers-color-scheme: dark) {
  .logo {
    color: var(--text-primary);
  }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

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

.site-nav a:not(.btn):hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .site-nav a:not(.btn) {
    display: none;
  }
}

/* ---------- Przyciski ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 1.4rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--purple);
  color: #fff;
}

.btn-primary:hover {
  background: var(--purple-pressed);
}

.btn-small {
  min-height: 40px;
  padding: 0 1.05rem;
  font-size: 0.95rem;
}

/* ---------- Hero ---------- */

.hero {
  padding: clamp(1.5rem, 4vw, 3.5rem) 0 clamp(3.5rem, 8vw, 6.5rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1.4rem;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--spark);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--spark) 30%, transparent);
}

h1 .accent {
  display: block;
  color: var(--purple);
}

@media (prefers-color-scheme: dark) {
  h1 .accent {
    color: var(--interactive-primary);
  }
}

h1 mark {
  color: inherit;
  background: linear-gradient(transparent 62%, color-mix(in srgb, var(--spark) 70%, transparent) 62% 92%, transparent 92%);
  padding-inline: 0.04em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

@media (prefers-color-scheme: dark) {
  h1 mark {
    background: linear-gradient(transparent 78%, color-mix(in srgb, var(--spark) 55%, transparent) 78% 94%, transparent 94%);
  }
}

.lead {
  margin-top: 1.5rem;
  font-size: clamp(1.1rem, 1rem + 0.35vw, 1.28rem);
  color: var(--text-secondary);
  max-width: 33em;
}

/* „Paragon” z rozliczeniem */

.receipt-wrap {
  position: relative;
  margin: 0;
  justify-self: center;
  width: min(380px, 100%);
}

.receipt {
  position: relative;
  background: var(--paper);
  padding: 1.6rem 1.5rem 2.2rem;
  font-family: var(--mono);
  font-size: 0.92rem;
  line-height: 1.5;
  rotate: 1.5deg;
  box-shadow: 0 1px 1px rgb(23 19 46 / 0.08), 0 22px 44px rgb(33 5 106 / 0.16);
  /* ząbkowana dolna krawędź */
  --tooth: 10px;
  mask:
    linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth)) no-repeat,
    conic-gradient(from 135deg at top, #000 90deg, #0000 0) bottom / calc(var(--tooth) * 2) var(--tooth) repeat-x;
}

.receipt-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.9rem;
  margin-bottom: 0.9rem;
  border-bottom: 2px dashed var(--rule);
}

.receipt-title {
  font-family: var(--font-family);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.receipt-sub {
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.receipt-lines {
  margin: 0;
  display: grid;
  gap: 0.7rem;
}

.receipt-lines .line {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.receipt-lines dt {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.5rem;
}

.receipt-lines .line::after {
  content: "";
  order: 1;
  flex: 1;
  border-bottom: 2px dotted var(--rule);
  translate: 0 -0.3em;
  min-width: 1rem;
}

.receipt-lines dd {
  order: 2;
  margin: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tag {
  font-family: var(--font-family);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--status-warning-surface);
  color: var(--status-warning-text);
  white-space: nowrap;
}

.tag.ok {
  background: var(--status-success-surface);
  color: var(--status-success-text);
}

.receipt-total {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 2px dashed var(--rule);
}

.receipt-total span:first-child {
  flex: 1;
  font-weight: 700;
}

.receipt-total strong {
  font-family: var(--font-family);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--purple);
  font-variant-numeric: tabular-nums;
}

@media (prefers-color-scheme: dark) {
  .receipt-total strong {
    color: var(--interactive-primary);
  }
}

.receipt-total .per {
  color: var(--text-secondary);
}

.receipt-foot {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.receipt-mascot {
  position: absolute;
  width: 140px;
  right: -64px;
  bottom: -58px;
  rotate: 8deg;
  filter: drop-shadow(0 10px 14px rgb(33 5 106 / 0.16));
}

@media (max-width: 560px) {
  .receipt-wrap {
    width: calc(100% - 1.5rem);
  }

  .receipt-mascot {
    width: 104px;
    left: auto;
    right: -26px;
    bottom: -52px;
    rotate: 6deg;
  }
}

/* ---------- Formularz zapisu ---------- */

.signup {
  margin-top: 2rem;
  max-width: 32rem;
}

.signup label.field-label {
  display: block;
  font-weight: 700;
}

.signup .hint {
  display: block;
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.signup-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.signup input[type="email"] {
  flex: 1 1 14rem;
  min-height: 52px;
  padding: 0 1.1rem;
  font: inherit;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 2px solid var(--rule);
  border-radius: 999px;
}

.signup input[type="email"]:focus-visible {
  outline: none;
  border-color: var(--interactive-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--interactive-primary) 20%, transparent);
}

.signup .btn {
  min-height: 52px;
}

.signup fieldset {
  border: 0;
  padding: 0;
  margin: 0.85rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
  align-items: center;
  font-size: 0.95rem;
}

.signup legend {
  float: left;
  margin-right: 0.2rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.signup .choice,
.signup .consent {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  cursor: pointer;
}

.signup .consent {
  margin-top: 0.7rem;
  align-items: flex-start;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.signup .consent input {
  margin-top: 0.3rem;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.signup .hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.error-msg {
  display: none;
  margin-top: 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--status-danger-text);
}

.signup input:is(:user-invalid, .user-invalid-fallback) {
  border-color: var(--status-danger-icon);
  background: var(--status-danger-surface);
}

/* Komunikat błędu jest za wierszem z polem, więc szukamy go od wiersza */
.signup .signup-row:has(input:user-invalid) + .error-msg,
.signup .signup-row:has(input.user-invalid-fallback) + .error-msg,
.signup .consent:has(input:user-invalid) + .error-msg {
  display: block;
}

.form-status {
  margin-top: 0.9rem;
  font-weight: 700;
  min-height: 1.5em;
}

.form-status[data-state="ok"] {
  color: var(--status-success-text);
}

.form-status[data-state="error"] {
  color: var(--status-danger-text);
}

.signup[data-done] .signup-body {
  display: none;
}

/* ---------- Sekcje ---------- */

section {
  scroll-margin-top: 24px;
}

.section {
  padding: clamp(1.5rem, 4vw, 2.5rem) 0;
}

.section > .wrap {
  border-top: 1px solid var(--rule);
  padding-top: clamp(2.5rem, 5vw, 3.5rem);
}

.section-lead {
  margin-top: 0.8rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 36em;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

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

.prose p {
  margin-top: 1.1rem;
  font-size: 1.12rem;
  color: var(--text-secondary);
  max-width: 32em;
}

.prose .aside {
  margin-top: 1.8rem;
  padding-left: 1rem;
  border-left: 3px solid var(--spark);
  font-size: 1rem;
}

/* Czat z przypomnieniem */

.chat {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 28px;
  padding: 1.1rem 1.1rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-width: 420px;
  justify-self: center;
  width: 100%;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--rule);
}

.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--avatar4);
  color: #17132e;
  font-weight: 800;
  font-size: 0.95rem;
}

.chat-time {
  align-self: center;
  margin: 0.6rem 0 0.2rem;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.bubble {
  max-width: 84%;
  padding: 0.6rem 0.9rem;
  border-radius: 20px;
  font-size: 0.97rem;
  line-height: 1.42;
}

.bubble.out {
  align-self: flex-end;
  background: var(--purple);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.bubble.in {
  align-self: flex-start;
  background: var(--bubble-in);
  color: var(--text-primary);
  border-bottom-left-radius: 6px;
}

.bubble.in + .bubble.in {
  margin-top: -0.15rem;
}

/* Prawdziwe ekrany */

.screens {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.screens img {
  border-radius: clamp(20px, 3vw, 34px) clamp(20px, 3vw, 34px) 0 0;
  border: 1px solid var(--rule);
  border-bottom: 0;
  background: var(--bg-card);
  mask: linear-gradient(#000 82%, transparent);
}

.screens img.no-fade {
  mask: none;
  border-radius: clamp(20px, 3vw, 34px);
  border-bottom: 1px solid var(--rule);
}

.screens p {
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.screens strong {
  color: var(--text-primary);
}

@media (max-width: 760px) {
  .screens {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 72%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.75rem;
    scrollbar-width: thin;
  }

  .screens li {
    scroll-snap-align: start;
  }
}

/* Czego Pocki nie robi */

.nots {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  counter-reset: not;
}

.nots li {
  counter-increment: not;
  display: grid;
  grid-template-columns: 3rem 1fr;
  column-gap: 1rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule);
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.nots li::before {
  content: counter(not, decimal-leading-zero);
  grid-row: span 2;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text-tertiary);
  padding-top: 0.35rem;
}

.nots strong {
  display: block;
  color: var(--text-primary);
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem);
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: 0.2rem;
}

/* ---------- FAQ ---------- */

.faq {
  margin-top: 1.5rem;
  max-width: 46rem;
}

.faq details {
  border-bottom: 1px solid var(--rule);
}

.faq summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75ch;
  padding: 1.15rem 0;
  font-weight: 700;
  font-size: 1.12rem;
  cursor: pointer;
}

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

.faq summary::before {
  content: "";
  inline-size: 1.05em;
  block-size: 1.05em;
  flex-shrink: 0;
  background-color: var(--interactive-primary);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M12 5v14'/%3E%3C/svg%3E")
    no-repeat center / contain;
}

.faq details[open] > summary::before {
  rotate: 45deg;
}

.faq .answer {
  padding: 0 0 1.25rem calc(1.05em + 0.75ch);
  color: var(--text-secondary);
}

.faq details::details-content {
  interpolate-size: allow-keywords;
  overflow: clip;
  contain: layout;
}

.faq details:not([open])::details-content {
  block-size: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .faq summary::before {
    transition: rotate 0.2s;
  }

  .faq details::details-content {
    transition: block-size, content-visibility;
    transition-duration: 0.3s;
    transition-timing-function: ease-in-out;
    transition-behavior: allow-discrete;
  }
}

/* ---------- Zapis na końcu ---------- */

.last-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
}

.last-mascot {
  width: 220px;
}

@media (max-width: 700px) {
  .last-grid {
    grid-template-columns: 1fr;
  }

  .last-mascot {
    width: 140px;
  }
}

.section-last .signup {
  margin-top: 1.4rem;
}

/* ---------- Stopka ---------- */

.site-footer {
  padding: 0 0 4rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.site-footer .wrap {
  display: grid;
  gap: 1rem;
  border-top: 1px solid var(--rule);
  padding-top: 2rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

.footer-links a {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* ---------- Dokumenty (polityka, regulamin) ---------- */

.doc {
  padding: 2rem 0 4rem;
}

.doc .wrap {
  max-width: 44rem;
}

.doc h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
}

.doc h2 {
  font-size: 1.35rem;
  margin-top: 2.25rem;
}

.doc p,
.doc li {
  color: var(--text-secondary);
}

.doc p {
  margin-top: 0.75rem;
}

.doc ul,
.doc ol {
  margin: 0.75rem 0 0;
  padding-left: 1.3rem;
}

.doc li + li {
  margin-top: 0.35rem;
}

.doc .meta {
  margin-top: 0.75rem;
  font-size: 0.95rem;
}

.todo {
  background: var(--status-warning-surface);
  color: var(--status-warning-text);
  font-weight: 700;
  padding: 0 0.3em;
  border-radius: 4px;
}
