/* ==========================================================================
   Carta Magna — /qr ad landing page
   Standalone stylesheet: no marketing nav, no transitions, no shared scripts.
   ========================================================================== */

:root {
  --bg: #f6e8d7;
  --surface: #fbf4ea;
  --sunken: #efdfcc;
  --ink: #24160f;
  --text: #3b2a20;
  --muted: #6e5646;
  --border: #dcc7b2;
  --border-strong: #c4a98f;
  --magna: #9e1f22;
  --magna-700: #7e1818;
  --crema: #f6e6c8;
  --ok: #4f5f38;
  --danger: #9e1f22;
  --terracota: #b8653c;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 26px 70px -34px rgba(42, 22, 12, 0.5);

  /* Brand type — the same faces the rest of cartamagna.club loads */
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, ui-serif, serif;
  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --inscription: "Cinzel", "Trajan Pro", Georgia, serif;
  --display: "Anton", "Instrument Sans", ui-sans-serif, system-ui, sans-serif;

  /* Display-title tones, cycled word by word like the rest of the site:
     Rojo Magna -> Mar de Tarde -> Terracota */
  --tone-a: #9e1f22;
  --tone-b: #5b7584;
  --tone-c: #b8653c;

  /* Tokens the shared footer (assets/css/footer.css) reads from the site */
  --bg-dark: #1a110c;
  --text-on-dark: #f6e8d7;
  --text-on-dark-muted: #c9b39d;
  --fs-caption: 0.8125rem;
  --ease-ola: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* No scroll effects: anchor jumps and programmatic scrolls are instant. */
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100dvh;
  /* Keep the shared footer at the bottom of short pages instead of leaving a
     strip of page background under it. */
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 90% at 12% 0%, #fbeedb 0%, var(--bg) 45%, #eddcc6 100%);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1 0 auto;
  min-width: 0;
}

img,
svg,
iframe {
  display: block;
  max-width: 100%;
}

/* Author `display` rules must not resurrect elements toggled with `hidden`. */
[hidden] {
  display: none !important;
}

a {
  color: var(--magna);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--crema);
  z-index: 50;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
}

/* ---------------------------------------------------------------- topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 1.1rem 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
}
/* The crest + wordmark are the site's own brand block: Cinzel for the name,
   Instrument Sans for the sub-label. */
.brand__crest {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 4px 12px rgba(78, 51, 34, 0.28));
}
.brand__word {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand__word b {
  font-family: var(--inscription);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}
.brand__word span {
  margin-top: 3px;
  font-family: var(--sans);
  font-size: 0.625rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--terracota);
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
/* The nav CTA is the call pill the rest of the site uses: icon + “Llámanos”,
   with the number joining it as soon as there is room for it. */
.topbar__call svg {
  flex: 0 0 auto;
  color: var(--magna);
}
.topbar__call-number {
  display: none;
  font-weight: 400;
}
@media (min-width: 620px) {
  .topbar__call-number {
    display: inline;
  }
}

/* ------------------------------------------------------------------- hero */
.hero {
  display: grid;
  gap: 2rem;
  max-width: 1160px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--magna);
  font-family: var(--inscription);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* Display title, in the same voice as the site's heroes: Anton, condensed and
   set in capitals, painted word by word by qr.js with the three brand tones
   (with JS off it keeps the two-tone fallback below). */
.hero__title {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.1rem, 1.1rem + 3.8vw, 4rem);
  line-height: 0.96;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--tone-a);
  text-wrap: balance;
}
.hero__line {
  display: block;
}
/* No-JS fallback: the second line takes the second tone, the rest of the title
   keeps the first, so the poster reads in two colours even without the script. */
.hero__title .hero__line--accent {
  color: var(--tone-b);
}
.hero__title .tw--magna {
  color: var(--tone-a);
}
.hero__title .tw--mar {
  color: var(--tone-b);
}
.hero__title .tw--terracota {
  color: var(--tone-c);
}

.hero__lede {
  max-width: 34ch;
  margin: 0 0 1.4rem;
  color: var(--text);
  font-size: 1.06rem;
}

.hero__points {
  display: grid;
  gap: 0.4rem;
  margin: 0 0 1.6rem;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
  color: var(--muted);
}
.hero__points li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.hero__points span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: rgba(124, 132, 82, 0.16);
  color: var(--ok);
  font-size: 0.7rem;
  font-weight: 700;
}

/* ------------------------------------------------------------------- card */
.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1.1rem;
}

/* Step changes scroll the wizard card to the top of the viewport; keep a small
   breathing gap so the steps bar never touches the screen edge. */
#generador {
  scroll-margin-top: 12px;
}

/* Step 5 — the card is being built. Each beat is a centred column inside the
   wizard card, so the card is exactly as tall as the beat (no overlay, no
   reserved height). */
.build-step {
  padding-block: 0.2rem;
}
.build-stage {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.6rem;
  width: 100%;
  max-width: 460px;
  min-height: 260px;
  margin: 0 auto;
  padding: 1rem 0.2rem;
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}
.build-stage.is-visible {
  opacity: 1;
  transform: none;
}
.build-generating__title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem);
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--tone-a);
}
.build-generating__status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.build-offer__dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--magna);
  animation: build-pulse 1.4s ease-in-out infinite;
}
@keyframes build-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Curiosities slideshow: one slide at a time, dots on top of each other. */
.build-slideshow {
  width: 100%;
  max-width: 420px;
  margin: 1.6rem auto 0;
}
.build-slideshow__title {
  margin: 0 0 0.2rem;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
}
.build-slideshow__list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  min-height: 3.6rem;
  font-family: var(--sans);
}
.build-slideshow__list li {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 0.2rem;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}
.build-slideshow__list li.is-active {
  opacity: 1;
  transform: none;
}

.account-overlay__spinner {
  justify-self: center;
  width: 34px;
  height: 34px;
  margin-bottom: 0.4rem;
  border: 3px solid rgba(158, 31, 34, 0.2);
  border-top-color: var(--magna);
  border-radius: 50%;
  animation: account-spin 0.9s linear infinite;
}
@keyframes account-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .account-overlay__spinner {
    animation: none;
  }
  .build-stage,
  .build-slideshow__list li {
    transition: none;
  }
}

/* The mockup sits at the very top of the viewport when the result opens. */
#phoneStage {
  scroll-margin-top: 12px;
}

/* Welcome message that replaces the account card once the visitor has one. */
.account-owned {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.account-owned__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.9rem, 1.3rem + 1.8vw, 2.5rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--tone-a);
  text-wrap: balance;
}
.account-owned__title .tw--magna {
  color: var(--tone-a);
}
.account-owned__title .tw--mar {
  color: var(--tone-b);
}
.account-owned__title .tw--terracota {
  color: var(--tone-c);
}
.account-owned__text {
  margin: 0;
  max-width: 48ch;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}
.account-owned__text a {
  color: var(--magna);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.account-owned__text a:hover,
.account-owned__text a:focus-visible {
  color: var(--magna-700);
}

.steps {
  display: flex;
  gap: 0.4rem;
  margin: 0 0 1.1rem;
  padding: 0;
  list-style: none;
}
.steps__item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  padding: 0.45rem 0.5rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.steps__num {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  font-size: 0.68rem;
}
.steps__label {
  overflow: hidden;
  text-overflow: ellipsis;
}
.steps__item.is-active {
  background: rgba(158, 31, 34, 0.08);
  color: var(--magna);
}
.steps__item.is-active .steps__num {
  border-color: var(--magna);
  background: var(--magna);
  color: #fff8ef;
}
.steps__item.is-done .steps__num {
  border-color: var(--magna);
  color: var(--magna);
}

/* Every wizard step slides/fades in when it replaces the previous one, so
   moving forward or back reads as a transition instead of a hard swap. */
.step {
  animation: step-in 0.32s var(--ease-ola) both;
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* The progress pills change state along with the content. */
.steps__item,
.steps__num {
  transition:
    background-color 0.2s var(--ease-ola),
    border-color 0.2s var(--ease-ola),
    color 0.2s var(--ease-ola);
}

@media (prefers-reduced-motion: reduce) {
  .step {
    animation: none;
  }
  .steps__item,
  .steps__num {
    transition: none;
  }
}

.step__title {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  font-weight: 700;
}
.step__hint {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* drop zone */
.drop {
  display: grid;
  place-items: center;
  gap: 0.25rem;
  padding: 2rem 1rem;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: rgba(239, 223, 204, 0.35);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.drop:hover,
.drop:focus-within,
.drop.is-over {
  border-color: var(--magna);
  background: rgba(158, 31, 34, 0.06);
  color: var(--magna);
}
.drop__title {
  margin-top: 0.35rem;
  font-weight: 700;
  color: var(--ink);
}
.drop__sub {
  font-size: 0.82rem;
}

/* thumbnails */
.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 72px));
  justify-content: start;
  gap: 0.4rem;
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
}
.thumb {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--sunken);
  aspect-ratio: 1;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb__meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.25rem 0.35rem;
  background: linear-gradient(transparent, rgba(20, 10, 6, 0.75));
  color: #fff;
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
}
.thumb__remove {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  display: grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 10, 6, 0.7);
  color: #fff;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}
.thumb__remove:hover {
  background: var(--magna);
}

/* fields */
.field {
  display: block;
  margin: 0 0 0.85rem;
}
.field > span {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}
.field input:focus,
.field textarea:focus {
  outline: 2px solid rgba(158, 31, 34, 0.35);
  outline-offset: 1px;
  border-color: var(--magna);
}
.field__control {
  position: relative;
}
.field--password input {
  padding-right: 3.2rem;
}
.field__toggle {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--magna);
  cursor: pointer;
}
.field__toggle svg {
  width: 18px;
  height: 18px;
}
.field__toggle:hover,
.field__toggle:focus-visible {
  background: rgba(158, 31, 34, 0.08);
}
.field textarea {
  resize: vertical;
  min-height: 6.5rem;
}
.field__count {
  display: block;
  margin-top: 0.2rem;
  text-align: right;
  color: var(--muted);
  font-size: 0.72rem;
}

.field__hint {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.grid2 {
  display: grid;
  gap: 0 0.75rem;
  grid-template-columns: 1fr 1fr;
}

.field > span em {
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.7;
}

.field-label {
  margin: 1.1rem 0 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.field-label em {
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.7;
}

/* logo picker */
.logo-drop {
  display: grid;
  place-items: center;
  gap: 0.2rem;
  min-height: 7.5rem;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: #fffdf8;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.logo-drop:hover,
.logo-drop:focus-within {
  border-color: var(--magna);
  background: rgba(158, 31, 34, 0.05);
}
.logo-drop__preview {
  max-width: 100%;
  max-height: 6rem;
  width: auto;
  height: auto;
  object-fit: contain;
}
.logo-drop__empty {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  font-size: 0.86rem;
  font-weight: 600;
}
.logo-drop__empty small {
  font-size: 0.74rem;
  font-weight: 500;
  opacity: 0.8;
}
.logo-drop.has-logo .logo-drop__empty {
  display: none;
}
.logo-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}
.logo-meta__remove {
  padding: 0.2rem 0.45rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--magna);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.logo-meta__remove:hover {
  background: rgba(158, 31, 34, 0.08);
}

/* closed-option cards */
.choices {
  display: grid;
  gap: 0.5rem;
  margin: 0;
}
.choices--palette {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.choices--accent {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.choices--mood,
.choices--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice {
  display: grid;
  justify-items: start;
  gap: 0.1rem;
  padding: 0.6rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fffdf8;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease,
    background 0.15s ease;
}
.choice:hover {
  border-color: var(--border-strong);
}
.choice:active {
  transform: translateY(1px);
}
.choice strong {
  font-size: 0.84rem;
  line-height: 1.2;
}
.choice small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.3;
}
.choice[aria-pressed="true"] {
  border-color: var(--magna);
  background: rgba(158, 31, 34, 0.06);
  box-shadow: 0 0 0 1px var(--magna) inset;
}
.choice[aria-pressed="true"] small {
  color: var(--magna);
}

.choice--palette {
  padding: 0.45rem;
}
.swatch {
  display: flex;
  width: 100%;
  height: 2.1rem;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.swatch i {
  flex: 1;
  background: var(--c-bg);
}
.swatch i:nth-child(2) {
  background: var(--c-ink);
}
.swatch i:nth-child(3) {
  background: var(--c-accent);
}
.swatch i:nth-child(4) {
  background: var(--c-surface);
}

.choice--accent {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.55rem;
}
.choice--accent i {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--dot);
  box-shadow: 0 0 0 2px #fffdf8, 0 0 0 3px rgba(0, 0, 0, 0.12);
}
.choice--accent span {
  overflow: hidden;
  font-size: 0.74rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.t-serif {
  font-family: var(--serif);
}
.t-sans {
  font-family: var(--sans);
}
.t-mixta {
  font-family: var(--serif);
}
.t-mixta::after {
  content: " + Aa";
  font-family: var(--sans);
  font-size: 0.72em;
  font-weight: 500;
}

/* menu source switch: photos vs natural-language text */
.source-tabs {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 0.9rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: var(--sunken);
}
.source-tab {
  flex: 1;
  min-height: 2.2rem;
  padding: 0.4rem 0.7rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.source-tab.is-active {
  background: #fffdf8;
  color: var(--magna);
  box-shadow: 0 2px 10px -6px rgba(42, 22, 12, 0.6);
}
.source-panel[hidden] {
  display: none !important;
}

.choices--palette + .choices--palette {
  margin-top: 0.5rem;
}
.more-palettes {
  margin: 0.55rem 0 0;
  text-align: center;
}

/* Owner-picked palette: four role tiles, each one a color input. */
.custom-palette {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}
.custom-palette__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.custom-palette__head .field-label {
  margin: 0;
}
.custom-palette__badge {
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: rgba(158, 31, 34, 0.1);
  color: var(--magna);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.custom-palette__tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.55rem;
}
.custom-tile {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  padding: 0.45rem 0.3rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fffdf8;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.custom-tile:hover {
  border-color: var(--border-strong);
  box-shadow: 0 8px 18px -14px rgba(42, 22, 12, 0.75);
}
.custom-tile:active {
  transform: translateY(1px);
}
/* The native picker covers the whole tile: tapping anywhere opens it. */
.custom-tile input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}
.custom-tile:focus-within {
  border-color: var(--magna);
  outline: 2px solid rgba(158, 31, 34, 0.35);
  outline-offset: 2px;
}
.custom-tile__chip {
  width: 100%;
  height: 2.4rem;
  border-radius: 8px;
  background: var(--tile, #fff);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}
.custom-tile__name {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}
.custom-tile__role {
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.25;
}
.custom-palette.is-active .custom-tile {
  border-color: var(--magna);
  box-shadow: 0 0 0 1px var(--magna) inset;
}
.custom-palette.is-active .custom-tile__role {
  color: var(--magna);
}
.linkbtn {
  padding: 0.2rem;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.linkbtn:hover {
  color: var(--magna);
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.6rem;
  padding: 0.55rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, opacity 0.15s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn--solid {
  background: var(--magna);
  color: #fff8ef;
  box-shadow: 0 10px 24px -14px rgba(158, 31, 34, 0.9);
}
.btn--solid:hover:not(:disabled) {
  background: var(--magna-700);
}
.btn--ghost {
  border-color: var(--border-strong);
  color: var(--ink);
  background: rgba(255, 253, 248, 0.6);
}
.btn--ghost:hover:not(:disabled) {
  border-color: var(--magna);
  color: var(--magna);
}
.btn--lg {
  width: 100%;
  min-height: 3.1rem;
  font-size: 1rem;
}
.btn--sm {
  min-height: 2.1rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
}

.actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1rem;
}
.actions .btn--solid,
.actions .btn--ghost {
  flex: 1;
}

/* progress */
.progress {
  margin-top: 1rem;
}
.progress__bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--sunken);
}
.progress__bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--magna), #c97a4a);
  transition: width 0.4s ease;
}
.progress__text {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.form__error {
  margin: 0.7rem 0 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(158, 31, 34, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(158, 31, 34, 0.07);
  color: var(--danger);
  font-size: 0.85rem;
}

.turnstile {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

/* ----------------------------------------------------------------- result */
.result {
  /* The page gutter, read by the blocks that deliberately bleed out of it. */
  --result-gutter: 1.25rem;
  max-width: 1160px;
  margin: 0 auto;
  padding: 1rem var(--result-gutter) 4rem;
}
.result__head {
  max-width: 52ch;
  margin: 0 auto 1.4rem;
  text-align: center;
}
.result__title {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.9rem, 1.3rem + 2vw, 2.8rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--tone-a);
  text-wrap: balance;
}
.result__title .tw--magna {
  color: var(--tone-a);
}
.result__title .tw--mar {
  color: var(--tone-b);
}
.result__title .tw--terracota {
  color: var(--tone-c);
}
.result__lede {
  margin: 0;
  color: var(--muted);
}

.result__body {
  display: grid;
  max-width: 860px;
  margin-inline: auto;
  gap: 1.5rem;
  align-items: start;
}
.result__body > * {
  min-width: 0;
}

/* phone */
/* The screen inside the mockup always lays out at 370px, so the preview page
   renders at a real mobile width instead of reflowing to the container. The
   bezel wraps that fixed screen and the WHOLE body is then scaled DOWN (never
   up) to fit the stage. `.phone` is just the stage that reserves the room the
   scaled body occupies; fitPreviewPhone() (qr.js) sets the scale and height. */
.phone {
  position: relative;
  width: 100%;
  min-width: 0;
  margin: 0;
}
.phone__body {
  /* content-box: `width` is the iframe's width; the bezel padding sits on top
     of those 370px. */
  box-sizing: content-box;
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--phone-screen-w, 370px);
  min-width: var(--phone-screen-w, 370px);
  padding: 0.55rem;
  border-radius: 42px;
  background: #17110d;
  box-shadow: 0 30px 70px -28px rgba(30, 15, 8, 0.65);
  transform: translateX(-50%) scale(var(--phone-scale, 1));
  transform-origin: top center;
}
.phone__notch {
  position: absolute;
  top: 0.55rem;
  z-index: 3;
  left: 50%;
  transform: translateX(-50%);
  width: 34%;
  height: 1.15rem;
  border-radius: 0 0 0.7rem 0.7rem;
  background: #17110d;
  z-index: 2;
}
.phone iframe {
  width: 100%;
  aspect-ratio: 9 / 19.2;
  border: 0;
  border-radius: 34px;
  background: #fff;
}

.result__side {
  display: grid;
  gap: 1rem;
  min-width: 0;
  max-width: 380px;
  width: 100%;
  margin: 0 auto;
}

/* Tabs — mobile only. From 980px up both panels sit side by side (the result
   body is a two-column grid) and the switcher is not rendered. */
.result__tabs {
  display: none;
}
.result__tab {
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
@media (max-width: 979px) {
  .result {
    --result-gutter: 1rem;
  }
  /* The stage (and the QR card) bleed out of the page gutter so a phone can
     still show the preview at its full 370px, with only a slim frame around it. */
  .phone {
    width: calc(100% + 2 * var(--result-gutter));
    margin-inline: calc(-1 * var(--result-gutter));
  }
  .qrbox {
    margin-inline: calc(-1 * var(--result-gutter));
  }
  .result__tabs {
    display: flex;
    gap: 0.3rem;
    margin: 0 0 1.15rem;
    padding: 0.3rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--sunken);
  }
  .result__tab {
    flex: 1;
    min-height: 2.6rem;
    padding: 0 0.75rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.01em;
  }
  .result__tab:hover {
    color: var(--ink);
  }
  .result__tab.is-active {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 8px 18px -14px rgba(42, 22, 12, 0.9);
  }
  .result[data-tab="preview"] #resultQr {
    display: none;
  }
  .result[data-tab="qr"] #resultPreview {
    display: none;
  }
}

/* ---------------------------------------------------------------- account
   The card slides between the wizard (while the preview is being built) and
   the result (once it exists). The message goes first, then the form. */
.account-slot:empty {
  display: none;
}
/* Separate the account/register block from the preview above it. */
.account-slot {
  margin-top: 4.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}
.account-slot .account,
.account-slot .account-owned {
  margin-top: 0;
}
/* No card around the form: the widget sits directly on the page, so it can be
   dropped into any section without looking like an embedded box. */
.account {
  max-width: 640px;
  margin: 1.75rem auto 0;
  padding: 0;
  border: 0;
  background: none;
}
.account__sent {
  display: grid;
  justify-items: center;
  gap: 0.3rem;
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
  color: var(--muted);
}
.account__sent strong {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.15rem, 0.95rem + 0.8vw, 1.45rem);
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-wrap: balance;
}
.account__sent strong .tw--magna {
  color: var(--tone-a);
}
.account__sent strong .tw--mar {
  color: var(--tone-b);
}
.account__sent strong .tw--terracota {
  color: var(--tone-c);
}
.account__back {
  display: block;
  margin-top: 0.35rem;
}
/* Display title in the site's poster voice (Anton, painted word by word by
   paintTitles() with the three brand tones). */
.account__title {
  margin: 0 0 0.45rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.9rem, 1.3rem + 1.8vw, 2.5rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--tone-a);
  text-wrap: balance;
}
.account__title .tw--magna {
  color: var(--tone-a);
}
.account__title .tw--mar {
  color: var(--tone-b);
}
.account__title .tw--terracota {
  color: var(--tone-c);
}
/* The last word is marked: the page red behind cream type, the same band the
   rest of the site uses for a selected phrase. */
.account__title-mark {
  background-color: transparent;
  background-image: linear-gradient(var(--magna), var(--magna));
  background-repeat: no-repeat;
  background-position: 50% 52%;
  background-size: 100% 1.12em;
  padding-inline: 0.06em;
  color: var(--surface);
}
.account__title-mark .tw {
  color: inherit;
}
.account__title,
.account__lede {
  text-align: center;
}
.account__lede {
  margin: 0 auto;
  max-width: 56ch;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}
.account__benefits {
  display: grid;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
  color: var(--ink);
}
.account__benefits li {
  grid-area: 1 / 1;
  display: flex;
  gap: 0.55rem;
  opacity: 0;
  transition: opacity 0.45s ease;
}
.account__benefits li::before {
  content: "★";
  color: var(--terracota);
}
.account__benefits li.is-active {
  opacity: 1;
}
.account__form {
  margin-top: 1rem;
}
.account__hint {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.account__switch {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.account__done {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(79, 95, 56, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(79, 95, 56, 0.08);
}
.account__done-title {
  margin: 0;
  font-weight: 700;
  color: var(--ok);
}
.account__done-text {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.account .form__error a {
  color: inherit;
}

/* Both result panels open with a one-line explanation (what this is, what it
   is for) and keep it inside the tabpanel so it hides with its panel. */
.previewpanel,
.qrpanel {
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  min-width: 0;
}
.previewpanel__note,
.qrpanel__note {
  max-width: 42ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
  text-wrap: pretty;
}
.previewpanel__note p {
  margin: 0;
}
.previewpanel__note p + p {
  margin-top: 0.45rem;
}
.previewpanel__note .linkbtn,
.qrpanel__note .linkbtn {
  font-size: inherit;
  font-weight: 700;
  color: var(--magna);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.previewpanel__note .linkbtn:hover,
.previewpanel__note .linkbtn:focus-visible,
.qrpanel__note .linkbtn:hover,
.qrpanel__note .linkbtn:focus-visible {
  color: var(--magna-700);
}

/* QR panel: the explanation, then the card itself. The note lives inside the
   panel so it disappears together with the card on the phone's preview tab. */
/* The download lives on the word itself: there is no separate button. */
.qrpanel__note a {
  color: var(--magna);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.qrpanel__note a:hover,
.qrpanel__note a:focus-visible {
  color: var(--magna-700);
  text-decoration-thickness: 2px;
}

/* No box around the card: the artwork is the card (it carries its own rounded
   corners) and sits directly on the page, as wide as the phone preview. */
.qrbox {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
.qrbox img {
  width: 100%;
  /* Exactly as wide as the phone mockup looks at this size (set by
     fitPreviewPhone(); 360px is the unscaled width). */
  max-width: var(--preview-visual-w, 370px);
  height: auto;
}

/* ----------------------------------------------------------------- footer
   The shared site footer (assets/css/footer.css) closes the page, so this
   standalone landing page ends exactly like every other cartamagna.club page.
   Only its own container width has to be declared here: the rest of the site
   takes `.shell` from styles.css, which this page does not load. */
.bn-footer .shell {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* On the narrowest phones the brand block, the wordmark and the pill CTA have
   to share one row: drop the sub-label and tighten the crest instead of letting
   either wrap onto a second line. */
@media (max-width: 420px) {
  .topbar {
    gap: 0.6rem;
    padding: 0.8rem 1rem;
  }
  .brand {
    gap: 0.5rem;
    min-width: 0;
  }
  .brand__crest {
    width: 30px;
    height: 30px;
  }
  .brand__word b {
    font-size: 0.74rem;
    letter-spacing: 0.1em;
    white-space: nowrap;
  }
  .brand__word span {
    display: none;
  }
  .topbar__right {
    gap: 0.5rem;
  }
  .topbar__right .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    gap: 0.35rem;
    white-space: nowrap;
  }
  .topbar__call svg {
    width: 15px;
    height: 15px;
  }
  .hero__points {
    font-size: 0.9rem;
  }
}

/* ------------------------------------------------------------- responsive */
@media (min-width: 760px) {
  .grid2 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 980px) {
  .hero {
    grid-template-columns: 0.92fr 1.08fr;
    align-items: start;
    gap: 3rem;
    padding-top: 2.5rem;
  }
  /* Returning visitor: the wizard is hidden, so the hero is single column. */
  .hero.is-returning {
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: 1rem;
  }
  .hero.is-returning .hero__lede {
    max-width: 52ch;
  }
  .card {
    padding: 1.4rem;
  }
  /* Account widget: centred under the result, at a readable form width. */
  .account-slot {
    display: block;
  }
  .account {
    max-width: 640px;
    margin: 0 auto;
  }
  .account-owned {
    margin: 0 auto;
  }
  .result__body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3rem;
  }
  .result__side {
    margin: 0;
  }
}

@media (max-width: 759px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
  .choices--palette,
  .choices--mood {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .choices--accent {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .custom-palette__tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .topbar {
    padding: 0.9rem 1rem;
  }
  .hero {
    padding: 1rem 1rem 3rem;
  }
  .result {
    padding: 1rem var(--result-gutter) 3rem;
  }
  .thumbs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Small phones (375px and narrower) keep a real gutter on both sides: the
   stage stops bleeding, so the same 370px screen is simply scaled down a bit
   more and the mockup never touches the page edges. */
@media (max-width: 375px) {
  .phone {
    width: 100%;
    margin-inline: 0;
  }
}

@media (max-width: 560px) {
  .steps {
    justify-content: space-between;
    gap: 0.15rem;
  }
  .steps__item {
    flex: none;
    padding: 0.4rem;
  }
  .steps__label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Generated palette preview */
.palette-preview {
  margin: 0.2rem 0 0.55rem;
}
.palette-preview__card {
  display: grid;
  gap: 0.15rem;
  padding: 1rem;
  border: 1px solid var(--p-border);
  border-radius: var(--radius);
  background: var(--p-bg);
  color: var(--p-ink);
  box-shadow: var(--shadow);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.palette-preview__card.is-loading {
  opacity: 0.55;
}
.palette-preview__eyebrow {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--p-muted);
}
.palette-preview__title {
  font-size: 1.05rem;
  line-height: 1.2;
}
.palette-preview__text {
  font-size: 0.8rem;
  color: var(--p-muted);
}
.palette-preview__chip {
  justify-self: start;
  margin-top: 0.35rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--p-border);
  border-radius: 999px;
  background: var(--p-surface);
  color: var(--p-ink);
  font-size: 0.72rem;
  font-weight: 700;
}
.palette-preview__swatches {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.65rem;
}
.palette-preview__swatches i {
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 50%;
}
.palette-preview__swatches .is-bg {
  background: var(--p-bg);
}
.palette-preview__swatches .is-surface {
  background: var(--p-surface);
}
.palette-preview__swatches .is-ink {
  background: var(--p-ink);
}
.palette-preview__swatches .is-muted {
  background: var(--p-muted);
}
.palette-preview__swatches .is-accent {
  background: var(--p-accent);
}
.palette-actions {
  display: flex;
  margin: 0.1rem 0 0.5rem;
}

.choices.is-loading {
  opacity: 0.55;
}

.result__note {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.4;
  text-align: center;
}

/* Keep uploaded previews visually separate from the free-text field. */
.thumbs:not(:empty) + .source-text {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
