/* The creator's pages (OnlyFans and Fanvue): one split frame, system type, nothing from another site. The agency's colour
   comes only from /brand.css?c=<rrggbb> (lib/pages.ts), which resets the three --action variables; everything painted
   in the action colour reads them. The CSP allows no inline style: every state is a class or an attribute. The three
   neutral values below are written by stamp.mjs from the shared rule (DEFAULT_ACTION_COLOR through buttonColors). */
:root {
  --action: #5b5bd6;
  --action-strong: #4b4baf;
  --on-action: #ffffff;
  --side-bg: #111216;
  --side-text: #f2f2f5;
  --side-muted: #b4b5c0;
  --main-bg: #f5f5f7;
  --card: #ffffff;
  --text: #16171d;
  --muted: #555763;
  --border: #e1e2e8;
  --info-bg: #eef0fb;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--main-bg);
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 3px;
  border-radius: 4px;
}

.side :focus-visible {
  outline-color: #ffffff;
}

.frame {
  display: grid;
  grid-template-columns: minmax(300px, 35%) 1fr;
  min-height: 100vh;
}

/* The dark side: agency, platform, title, the three promises, who sent it. */
.side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 48px 40px 32px;
  background: var(--side-bg);
  color: var(--side-text);
}

.agency {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.agency-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  background: #ffffff;
}

.agency-mark {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--action);
  color: var(--on-action);
  font-weight: 700;
}

.platform {
  width: 44px;
  height: 44px;
  margin-top: 24px;
}

.side h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.sub {
  margin: 0;
  color: var(--side-muted);
  font-size: 1.05rem;
}

.points {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: auto 0 0;
  padding: 32px 0 0;
  list-style: none;
}

.points li {
  display: flex;
  align-items: center;
  gap: 12px;
}

.points svg {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--side-muted);
}

.sent {
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 1px solid #2a2b33;
  color: var(--side-muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.badge {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  background: #b45309;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
}

/* The light side: one thing to do at a time. */
.main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 680px;
  padding: 48px 56px 32px;
}

.flow {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.progress {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bar {
  flex: 1;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.fill {
  display: block;
  width: 33.4%;
  height: 100%;
  border-radius: 999px;
  background: var(--action);
}

.bar[data-step='2'] .fill {
  width: 66.7%;
}

.bar[data-step='3'] .fill {
  width: 100%;
}

.valid {
  margin-left: auto;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.card,
.step.current {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 1px 2px rgb(0 0 0 / 4%);
}

.card h2,
.step-title {
  margin: 0 0 8px;
  font-size: 1.3rem;
  line-height: 1.3;
}

.card p,
.step-body p {
  margin: 0 0 16px;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A step not yet reached is one folded line; one already done is gone (Back brings it again). */
.step {
  padding: 14px 20px;
  border-radius: 12px;
  color: var(--muted);
}

.step:not(.current) .step-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.step:not(.current) .step-body,
.step.done {
  display: none;
}

.step.current {
  color: var(--text);
}

.step-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.num {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  font-size: 0.85rem;
  font-weight: 700;
}

.step.current .num {
  border-color: var(--action);
  background: var(--action);
  color: var(--on-action);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: 10px;
  background: var(--action);
  color: var(--on-action);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--action-strong);
}

.button-mark {
  flex: none;
  width: 22px;
  height: 22px;
}

.wide {
  width: 100%;
}

button.secondary,
.button.secondary {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button.secondary:hover,
.button.secondary:hover {
  background: var(--main-bg);
}

.link-button {
  padding: 10px 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.hint {
  color: var(--muted);
  font-size: 0.95rem;
}

/* A line under a button belongs to it, but not glued to it; a step that opens on a button gets air under its title. */
.button + p {
  margin-top: 12px;
}

.step-body > .button:first-child {
  margin-top: 8px;
}

.hint a {
  color: var(--text);
}

.info {
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--info-bg);
  font-size: 0.95rem;
}

.copy-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--main-bg);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}

.note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.lead {
  margin: 0;
  font-size: 1.05rem;
}

.box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
}

.box-label {
  font-size: 0.85rem;
  font-weight: 700;
}

.plain {
  margin: 0;
  padding-left: 1.4em;
}

.plain li + li {
  margin-top: 6px;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.note-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 !important;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--main-bg);
  color: var(--muted);
  font-size: 0.9rem;
}

.note-box strong {
  color: var(--text);
}

.message {
  margin-top: auto;
  text-align: center;
}

.card > :last-child,
.step-body > :last-child {
  margin-bottom: 0;
}

/* The end pages have no promises: «Sent by» still sits at the bottom of the dark side. */
.side h1 + .sent {
  margin-top: auto;
}

.foot {
  margin: auto 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Narrow screens (a phone): the dark side becomes a header, the promises fold away. */
@media (max-width: 760px) {
  .frame {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .side {
    gap: 12px;
    padding: 24px 20px;
  }

  .platform {
    width: 36px;
    height: 36px;
    margin-top: 8px;
  }

  .side h1 {
    font-size: 1.5rem;
  }

  .points,
  .sent {
    display: none;
  }

  .main {
    padding: 24px 20px;
  }

  .card,
  .step.current {
    padding: 20px;
  }

  .button {
    width: 100%;
  }

  .notes {
    grid-template-columns: 1fr;
  }

  .progress {
    flex-wrap: wrap;
  }
}
