:root {
  color-scheme: light dark;
  --ink: #151515;
  --muted: #68635c;
  --paper: #f7f4ee;
  --panel: #fffdf8;
  --line: #ddd6c9;
  --field: rgba(255, 253, 248, 0.9);
  --field-soft: rgba(255, 253, 248, 0.62);
  --on-ink: #fffdf8; /* text on ink-colored solids (flips with theme) */
  --on-light: #15130e; /* text on light accents (sage/sky/gold) */
  --cream: #fffdf8; /* text on dark accents (moss/coral) — stays light */
  --sage: #c9d8c1;
  --moss: #415344;
  --coral: #e46f54;
  --sky: #bed8e6;
  --gold: #ebc76d;
  --shadow: 0 24px 70px rgba(36, 31, 23, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1ece2;
    --muted: #a79f91;
    --paper: #000000;
    --panel: #121110;
    --line: #2c2925;
    --field: rgba(255, 253, 248, 0.05);
    --field-soft: rgba(255, 253, 248, 0.03);
    --on-ink: #131210;
    --on-light: #15130e;
    --cream: #fdf8ee;
    --sage: #c9d8c1;
    --moss: #415344;
    --coral: #e46f54;
    --sky: #bed8e6;
    --gold: #ebc76d;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.7);
  }

  /* Flat black background — no side glows. */
  body {
    background: var(--paper);
  }
}

* {
  box-sizing: border-box;
}

/* Test-mode badge: only visible when body.is-mock is set (sample data, no API). */
.mock-badge {
  display: none;
  position: fixed;
  z-index: 90;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--gold);
  color: #15130e;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 30px rgba(36, 31, 23, 0.22);
}

body.is-mock .mock-badge {
  display: block;
}

/* Login: dyskretne wejście dla istniejących klientów (prawy górny róg). */
.login-link {
  position: fixed;
  z-index: 90;
  top: 14px;
  right: 18px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 253, 248, 0.25);
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity 0.15s, border-color 0.15s;
}

.login-link:hover {
  opacity: 1;
  border-color: rgba(255, 253, 248, 0.55);
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(115deg, rgba(190, 216, 230, 0.34), transparent 34%),
    linear-gradient(300deg, rgba(201, 216, 193, 0.34), transparent 36%),
    var(--paper);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

/* ---------- Hero: copy + paste (left), live preview (right) ---------- */
.hero-screen {
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: 32px clamp(18px, 4vw, 56px);
}

.hero-layout {
  display: grid;
  /* Right column is the bigger one and stays the SAME across idle / generating /
     checkout, so the preview is large and never reflows the left side. */
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  width: min(1280px, 100%);
  margin: 0 auto;
}

.hero-copy {
  max-width: 640px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  font-size: 14px;
  font-weight: 800;
}

.brand-dot {
  width: 13px;
  height: 13px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 8px 0 0 var(--gold);
}

.hero-copy h1 {
  margin: 0 0 20px;
  font-size: clamp(40px, 6.2vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.01em;
}

.hero-sub {
  margin: 0 0 30px;
  max-width: 520px;
  color: var(--muted);
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.5;
}

/* ---------- Link form ---------- */
.link-form {
  width: min(560px, 100%);
}

.link-form label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  box-shadow: 0 16px 50px rgba(36, 31, 23, 0.08);
}

.input-row input {
  min-width: 0;
  height: 52px;
  border: 0;
  outline: 0;
  border-radius: 6px;
  padding: 0 14px;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
}

.input-row input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.submit-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  color: var(--on-ink);
  background: var(--ink);
  font-weight: 800;
  transition: transform 180ms ease;
}

.submit-action:hover {
  transform: translateY(-2px);
}

.form-status {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Grab-your-link icons ---------- */
.grab-helper {
  margin-top: 18px;
}

.grab-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.grab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.grab-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--field);
  transition:
    transform 160ms ease,
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.grab-icon:hover {
  transform: translateY(-2px);
  color: var(--on-ink);
  background: var(--ink);
  border-color: transparent;
}

/* ---------- Right column: live preview / output ---------- */
.result-panel {
  position: relative;
  border-radius: 8px;
}

/* Frameless: the generated site shows on its own, no surrounding box. */
body.is-analyzed .result-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--moss);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (prefers-color-scheme: dark) {
  .eyebrow {
    color: var(--sage);
  }
}

/* Header (Output / company / platform pill) is hidden in the frameless preview. */
.result-header {
  display: none;
}

.result-header h3 {
  margin: 0;
  font-size: 22px;
}

.platform-pill {
  flex: 0 0 auto;
  max-width: 150px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--on-light);
  background: var(--sage);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Idle hero visual: a floating site mockup */
.preview-idle {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 460px;
}

.preview-idle::before {
  content: "";
  position: absolute;
  inset: 26px 0 14px 44px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, transparent 0 18px, rgba(65, 83, 68, 0.15) 18px 20px, transparent 20px),
    var(--sage);
  background-size: 28px 28px, auto;
  transform: rotate(-4deg);
  opacity: 0.85;
}

body.is-analyzed .preview-idle {
  display: none;
}

body.is-grabbing .preview-idle {
  opacity: 0.18;
  filter: blur(2px);
  transition:
    opacity 320ms ease,
    filter 320ms ease;
}

.preview-window {
  position: relative;
  width: min(420px, 92%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transform: rotate(2deg);
  overflow: hidden;
  animation: floaty 6s ease-in-out infinite;
}

@keyframes floaty {
  0%,
  100% {
    transform: rotate(2deg) translateY(0);
  }
  50% {
    transform: rotate(2deg) translateY(-8px);
  }
}

.window-top {
  display: flex;
  gap: 7px;
  height: 38px;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--field);
}

.window-top span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--coral);
}

.window-top span:nth-child(2) {
  background: var(--gold);
}

.window-top span:nth-child(3) {
  background: var(--sage);
}

.mini-site {
  padding: 18px;
}

.mini-cover,
.draft-cover {
  height: 126px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(228, 111, 84, 0.85), rgba(235, 199, 109, 0.82)),
    linear-gradient(90deg, var(--sky), var(--sage));
}

.mini-avatar {
  width: 74px;
  height: 74px;
  margin: -34px 0 0 18px;
  border: 7px solid var(--panel);
  border-radius: 50%;
  background:
    linear-gradient(135deg, var(--moss) 0 50%, var(--sky) 50%),
    var(--moss);
}

.mini-lines,
.mini-actions,
.mini-gallery {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.mini-lines span {
  display: block;
  height: 14px;
  border-radius: 8px;
  background: var(--line);
}

.mini-lines span:first-child {
  width: 66%;
  height: 19px;
  background: var(--ink);
}

.mini-lines span:last-child {
  width: 88%;
}

.mini-actions {
  grid-template-columns: 1fr 1fr;
}

.mini-actions span,
.draft-buttons span {
  height: 42px;
  border-radius: 8px;
  background: var(--ink);
}

.mini-actions span:last-child {
  background: var(--sage);
}

.mini-gallery {
  grid-template-columns: repeat(3, 1fr);
}

.mini-gallery span,
.draft-grid span {
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--sky);
}

.mini-gallery span:nth-child(2),
.draft-grid span:nth-child(2) {
  background: var(--gold);
}

.mini-gallery span:nth-child(3),
.draft-grid span:nth-child(3) {
  background: var(--coral);
}

/* Generated site (after analyze) — frameless, large and pushed to the right.
   Big enough to actually judge the design, hugging the right edge. */
.generated-site {
  display: none;
  padding: 0;
  max-width: 700px;
  margin-left: auto;
}

body.is-analyzed .generated-site {
  display: block;
}

/* While generating, keep the idle mock hidden under the progress panel. */
body.is-generating .preview-idle {
  display: none;
}

/* ---------- Generation progress steps ---------- */
.gen-progress {
  display: grid;
  gap: 14px;
  min-height: 420px;
  align-content: center;
  /* Center the steps as a group within the right-hand preview block so they
     sit further right (where the generated site will appear), not near center. */
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
  padding: 8px 6px;
}

.gen-step {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  opacity: 0.6;
  transition:
    color 300ms ease,
    opacity 300ms ease;
}

.gen-step .gen-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
  transition:
    background 300ms ease,
    box-shadow 300ms ease;
}

.gen-step.active {
  color: var(--ink);
  opacity: 1;
}

.gen-step.active .gen-dot {
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(228, 111, 84, 0.18);
}

.gen-step.done {
  color: var(--moss);
  opacity: 1;
}

@media (prefers-color-scheme: dark) {
  .gen-step.done {
    color: var(--sage);
  }
}

.gen-step.done .gen-dot {
  background: var(--moss);
  box-shadow: none;
}

/* ---------- Real in-panel preview ---------- */
/* Element display rules beat the UA [hidden] style, so hide explicitly. */
.gen-progress[hidden],
.gen-preview[hidden],
.gen-error[hidden] {
  display: none;
}

/* The scaled site: looks like a real desktop page, just smaller. No frame — only a soft lift.
   The iframe stays interactive so the user can scroll the whole site inside this mini window. */
.site-stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 30px 70px rgba(36, 31, 23, 0.18);
}

.site-scale {
  width: 1280px;
  height: 800px;
  transform-origin: top left;
  will-change: transform;
}

#genFrame {
  display: block;
  width: 1280px;
  height: 800px;
  border: 0;
  background: #fff;
}

/* Small expand control — opens the full-size overlay without boxing the preview. */
.site-expand {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  color: var(--on-ink);
  background: rgba(21, 21, 21, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition:
    opacity 180ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.site-stage:hover .site-expand,
.site-expand:focus-visible {
  opacity: 1;
}

.site-expand:hover {
  transform: translateY(-1px);
  background: var(--ink);
}

.gen-error {
  margin: 8px 4px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--coral);
  background: var(--field);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- Full-screen enlarged preview ---------- */
.preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  background: rgba(15, 13, 9, 0.62);
  backdrop-filter: blur(8px);
  padding: clamp(12px, 3vw, 40px);
}

.preview-overlay[hidden] {
  display: none;
}

.overlay-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: var(--panel);
}

.overlay-title {
  font-weight: 800;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overlay-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.overlay-open,
.overlay-close {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid var(--line);
}

.overlay-open {
  color: var(--ink);
  background: var(--field);
}

.overlay-close {
  color: var(--on-ink);
  background: var(--ink);
  border-color: transparent;
}

.overlay-frame {
  flex: 1;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  background: #fff;
}

.draft-cover {
  height: 150px;
}

.draft-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: -28px;
  padding: 0 14px;
}

.draft-avatar {
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  border: 7px solid var(--panel);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--moss), var(--sky));
}

.draft-profile strong,
.draft-profile span {
  display: block;
}

.draft-profile strong {
  font-size: 18px;
}

.draft-profile span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

#draftBio {
  min-height: 68px;
  margin: 20px 14px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.draft-buttons,
.draft-grid {
  display: grid;
  gap: 10px;
  margin: 14px;
}

.draft-buttons {
  grid-template-columns: 1fr 1fr;
}

.draft-buttons span {
  display: grid;
  place-items: center;
  color: var(--on-ink);
  font-size: 13px;
  font-weight: 800;
}

.draft-buttons span:last-child {
  background: var(--sage);
  color: var(--on-light);
}

.draft-grid {
  grid-template-columns: repeat(3, 1fr);
}

/* Actions sit directly under the site, no frame, spanning the same width as the preview. */
.review-actions {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  margin: 16px 0 0;
}

.review-actions button {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--field);
  font-weight: 800;
  font-size: 16px;
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.review-actions button:first-child {
  border-color: transparent;
  color: var(--cream);
  background: var(--moss);
}

.review-actions button:hover {
  transform: translateY(-2px);
}

.result-panel.is-loading .generated-site,
.result-panel.is-loading .preview-idle {
  animation: pulse 900ms ease-in-out infinite alternate;
}

@keyframes pulse {
  from {
    opacity: 0.55;
  }
  to {
    opacity: 1;
  }
}

/* ---------- Pointing arrow ---------- */
.point-arrow {
  position: fixed;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 340px;
  color: var(--coral);
  pointer-events: none;
  transition:
    top 420ms ease,
    left 420ms ease;
  animation: arrowNudge 1.1s ease-in-out infinite;
}

.point-arrow[hidden] {
  display: none;
}

.point-card {
  display: grid;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.point-platform {
  color: var(--moss);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (prefers-color-scheme: dark) {
  .point-platform {
    color: var(--sage);
  }
}

.point-title {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.point-sub {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.point-glyph {
  flex: 0 0 auto;
}

@keyframes arrowNudge {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(8px);
  }
}

.point-arrow.point-left {
  flex-direction: row-reverse;
  animation-name: arrowNudgeLeft;
}

.point-arrow.point-left .point-glyph {
  transform: scaleX(-1);
}

@keyframes arrowNudgeLeft {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-8px);
  }
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--ink);
  background: var(--panel);
  font: 700 11px Inter, system-ui, sans-serif;
  white-space: nowrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-screen {
    align-items: flex-start;
    min-height: auto;
    padding: 40px 18px;
  }

  .hero-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .preview-idle {
    min-height: 360px;
  }
}

@media (max-width: 560px) {
  .hero-copy h1 {
    font-size: clamp(36px, 11vw, 52px);
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .submit-action {
    width: 100%;
  }

  .preview-idle {
    min-height: 320px;
  }

  .preview-window {
    width: min(340px, 96%);
  }
}

/* ---------- Left column: hero copy ↔ checkout ---------- */
.hero-left {
  min-width: 0;
}

/* Keep the SAME columns AND vertical alignment through every state, so the left
   side never reflows and the preview stays in the same spot after "Looks good". */
body.is-checkout .hero-copy {
  display: none;
}

/* ---------- Checkout panel (slides in from the left) ---------- */
.checkout {
  width: 100%;
  max-width: 460px; /* keep form fields a sane width instead of stretching */
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: clamp(20px, 2.4vw, 30px);
  animation: checkoutIn 360ms ease;
}

.checkout[hidden] {
  display: none;
}

@keyframes checkoutIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.checkout-back {
  margin-bottom: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.checkout-back:hover {
  color: var(--ink);
}

.checkout h2 {
  margin: 2px 0 6px;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.05;
}

.checkout-sub {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 15px;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 18px;
}

.price {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.per {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.pay-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* never let inputs widen the form */
  gap: 12px;
}

.pay-label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pay-label input {
  width: 100%;
  min-width: 0; /* inputs default to a content width — clamp so they can't overflow */
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--field);
  font-size: 16px;
  outline: 0;
  transition: border-color 160ms ease;
}

.pay-label input:focus {
  border-color: var(--moss);
}

.pay-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

/* "Found on your page" hint under the pre-filled email */
.pay-hint {
  margin: -4px 0 2px;
  color: var(--moss);
  font-size: 12.5px;
  font-weight: 600;
}

.pay-hint[hidden] {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .pay-hint {
    color: var(--sage);
  }
}

.pay-cta {
  width: 100%;
  margin-top: 4px;
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  color: var(--on-ink);
  background: var(--ink);
  font-size: 16px;
  font-weight: 800;
  transition: transform 180ms ease;
}

.pay-cta:hover {
  transform: translateY(-2px);
}

.pay-status {
  min-height: 20px;
  margin: 4px 0 0;
  color: var(--moss);
  font-size: 14px;
  font-weight: 700;
}

@media (prefers-color-scheme: dark) {
  .pay-status {
    color: var(--sage);
  }
}

.pay-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pay-divider::before,
.pay-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Express methods mosaic — click once to arm, again to pay. */
.pay-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pay-method {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.pay-method:hover {
  transform: translateY(-2px);
  border-color: var(--moss);
}

.pay-method.armed {
  border-color: transparent;
  color: var(--cream);
  background: var(--moss);
}

.pay-trust {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Stripe Payment Element: shown only when Stripe is configured; hides the mock UI. */
.payment-element {
  margin-bottom: 4px;
}

.payment-element[hidden] {
  display: none;
}

body.is-stripe [data-mock] {
  display: none;
}

/* ---------- Responsive: keep states single-column on small screens ---------- */
@media (max-width: 900px) {
  body.is-analyzed .hero-layout,
  body.is-checkout .hero-layout {
    grid-template-columns: 1fr;
  }

  /* During checkout, show the demo site above the payment form for context. */
  body.is-checkout .result-panel {
    order: -1;
  }
}

/* ============================================================================
   TURA 1 — quiz personalizacji (zyje w oknie podgladu)
   ========================================================================== */
.generated-site { position: relative; }

.quiz-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 14px;
}
.quiz-layer[hidden] { display: none; }
.quiz-layer.over-site {
  background: rgba(21, 21, 21, 0.28);
  backdrop-filter: blur(2px);
  border-radius: 10px;
}

.quiz-card {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px 22px 20px;
  animation: quizIn 260ms ease;
}
@keyframes quizIn {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to   { opacity: 1; transform: none; }
}

.quiz-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.quiz-step {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.quiz-track { display: flex; gap: 5px; }
.quiz-track span {
  width: 18px;
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  transition: background 220ms ease;
}
.quiz-track span.done { background: var(--moss); }
.quiz-track span.active { background: var(--coral); }

.quiz-q { margin: 0 0 4px; font-size: 19px; line-height: 1.25; color: var(--ink); }
.quiz-hint { margin: 0 0 14px; font-size: 13px; color: var(--muted); }

.quiz-opts { display: grid; gap: 9px; }
.quiz-opt {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--field);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms ease, transform 120ms ease, background 150ms ease;
}
.quiz-opt:hover { border-color: var(--coral); transform: translateY(-1px); }
.quiz-opt:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.quiz-opt .sw {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.quiz-opt .av { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); }
.quiz-opt .av.free { color: var(--moss); }

/* Momentary "your tap registered" confirmation — shown right after any option
   is clicked, before advance() moves to the next question. Without this the
   card jumps to the next question so fast it looks like nothing happened. */
.quiz-opt.picked {
  border-color: var(--moss);
  background: color-mix(in srgb, var(--moss) 14%, var(--field));
  opacity: 1;
}
.quiz-opt.picked::after { content: "✓"; margin-left: auto; color: var(--moss); font-weight: 800; }
.quiz-opt.picked .av { display: none; } /* avoid a stray "taken/free" badge clashing with the checkmark */

.quiz-custom { margin-top: 10px; }
.quiz-custom[hidden] { display: none; }
.quiz-custom-row { display: flex; gap: 7px; }
.quiz-custom input {
  flex: 1;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--field);
  color: var(--ink);
  font-size: 14px;
}
.quiz-custom button {
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--moss);
  color: var(--cream);
  font-weight: 700;
  cursor: pointer;
  min-width: 76px;
}
.quiz-custom button:disabled { opacity: 0.6; cursor: wait; }

/* Feedback line under the custom-address field: checking / free / taken.
   This is the piece that was missing — typing your own address gave zero
   indication of whether it was valid, being checked, or accepted. */
.quiz-custom-msg {
  margin: 7px 0 0;
  min-height: 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.quiz-custom-msg.checking { color: var(--muted); }
.quiz-custom-msg.free { color: var(--moss); }
.quiz-custom-msg.taken { color: var(--coral); }

.quiz-updating {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  background: rgba(247, 244, 238, 0.66);
  backdrop-filter: blur(3px);
  border-radius: 10px;
}
@media (prefers-color-scheme: dark) {
  .quiz-updating { background: rgba(0, 0, 0, 0.5); }
}
.quiz-updating[hidden] { display: none; }
.quiz-updating p {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.quiz-updating .wave { display: flex; gap: 8px; }
.quiz-updating .wave span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--coral);
  animation: quizWave 1s ease-in-out infinite;
}
.quiz-updating .wave span:nth-child(2) { animation-delay: 0.16s; }
.quiz-updating .wave span:nth-child(3) { animation-delay: 0.32s; }
@keyframes quizWave {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.55; }
  40% { transform: translateY(-9px); opacity: 1; }
}

body.is-quiz .review-actions { display: none; }
r(--coral);
  animation: quizWave 1s ease-in-out infinite;
}
.quiz-updating .wave span:nth-child(2) { animation-delay: 0.16s; }
.quiz-updating .wave span:nth-child(3) { animation-delay: 0.32s; }
@keyframes quizWave {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.55; }
  40% { transform: translateY(-9px); opacity: 1; }
}

/* W trakcie quizu chowamy przyciski recenzji — pojawią się po zakończeniu. */
body.is-quiz .review-actions {
  display: none;
}

/* ── "Improve" — mały czat inline pod przyciskami (bez overlay/zaciemniania) ── */
.improve-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  animation: improveIn 0.2s ease;
}
.improve-panel[hidden] { display: none; }

@keyframes improveIn {
  from { transform: translateY(-6px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.improve-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.improve-title { margin: 0; font-size: 17px; font-weight: 800; color: var(--ink); }
.improve-sub { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.improve-close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.improve-close:hover { color: var(--ink); }

.improve-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 42vh;
  overflow-y: auto;
}
.improve-log:empty { display: none; }

.improve-msg {
  max-width: 88%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
}
.improve-msg.user {
  align-self: flex-end;
  background: var(--ink);
  color: var(--on-ink);
  border-bottom-right-radius: 4px;
}
.improve-msg.bot {
  align-self: flex-start;
  background: var(--field);
  border: 1px solid var(--line);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.improve-msg.bot.ok { border-color: var(--moss); }
.improve-msg.bot.no { border-color: var(--coral); }
.improve-msg.typing { color: var(--muted); font-style: italic; }

.improve-form { display: flex; gap: 8px; }
.improve-form input {
  flex: 1;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--field);
  color: var(--ink);
  font-size: 14px;
}
.improve-form input:focus {
  outline: none;
  border-color: var(--muted);
}
.improve-form input:disabled { opacity: 0.5; }
.improve-send,
#improveSend {
  flex: 0 0 auto;
  width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 11px;
  background: var(--coral);
  color: var(--cream);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}
#improveSend:disabled { opacity: 0.45; cursor: default; }

.improve-foot {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-align: center;
}
.improve-foot.done { color: var(--coral); }
