/*
 * pottyplan.com/free-chart (site/free-chart.ts). The page uses the site tokens (site.css); the three
 * printable pages (.fc-page) are paper: true size, always white, in fixed pixels at 96 per inch.
 */

/* ---------- Landing ---------- */

.fc [hidden],
.fc-done [hidden] {
  display: none !important;
}

.fc {
  display: grid;
  gap: 28px;
  padding-top: 24px;
  padding-bottom: 72px;
  grid-template-areas: "intro" "art" "panel" "app";
}

.fc__intro {
  grid-area: intro;
}

.fc__intro h1 {
  font-size: clamp(2.2rem, 8.4vw, 3.7rem);
  margin-bottom: 12px;
}

.fc__intro .lede {
  margin: 0;
  max-width: 34ch;
}

.fc__art {
  grid-area: art;
  position: relative;
  border-radius: 28px;
  background: var(--teal-light);
  overflow: hidden;
}

.fc__points {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-weight: 600;
}

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

.fc__points svg {
  width: 26px;
  height: 26px;
  padding: 5px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--on-teal);
}

.fc__panel {
  grid-area: panel;
  align-self: start;
  background: var(--surface);
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-soft);
}

@media (min-width: 420px) {
  .fc__panel {
    padding: 28px 24px;
  }
}

.fc-form h2,
.fc-ready h2 {
  font-size: 1.6rem;
  margin-bottom: 20px;
}

.fc-field {
  display: block;
  margin-bottom: 18px;
}

.fc-field > span,
.fc-paper legend {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.fc-field input {
  box-sizing: border-box;
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1.5px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
  /* 17px keeps iPhone Safari from zooming in on focus. */
  font: 500 17px/1.2 var(--font-body);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.fc-field input::placeholder {
  color: var(--text-2);
  opacity: 0.7;
}

.fc-field input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 25%, transparent);
}

.fc-field input[aria-invalid="true"] {
  border-color: #c0552f;
}

.fc-field small {
  display: block;
  margin-top: 6px;
  font-size: 0.88rem;
  color: var(--text-2);
}

.fc-err {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 0.92rem;
  font-weight: 600;
  color: #b04a26;
}

@media (prefers-color-scheme: dark) {
  .fc-err {
    color: #f0a587;
  }
  .fc-field input[aria-invalid="true"] {
    border-color: #d9744f;
  }
}

.fc-paper {
  border: 0;
  margin: 0 0 18px;
  padding: 0;
}

.fc-paper__opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.fc-paper label {
  position: relative;
  display: flex;
}

.fc-paper input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
}

.fc-paper span {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s, color 0.15s;
}

.fc-paper input:checked + span {
  background: var(--teal-light);
  color: var(--teal-ink);
  box-shadow: inset 0 0 0 2px var(--teal);
}

.fc-paper input:focus-visible + span {
  outline: 3px solid var(--sun);
  outline-offset: 2px;
}

.fc-check {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
  min-height: 44px;
  padding: 4px 0 8px;
  margin-bottom: 14px;
  font-size: 0.95rem;
  color: var(--text-2);
  cursor: pointer;
}

.fc-check input {
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--teal);
}

.fc-check a {
  white-space: nowrap;
}

/* The honeypot: off screen, out of the tab order, hidden from screen readers. */
.fc-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.fc-form button[disabled] {
  opacity: 0.75;
  cursor: progress;
}

.fc-privacy {
  margin: 12px 0 0;
  font-size: 0.88rem;
  color: var(--text-2);
  text-align: center;
}

.fc-status {
  min-height: 1.5em;
  margin: 12px 0 0;
  font-size: 0.95rem;
  color: var(--text-2);
  text-align: center;
}

.fc-status.is-error {
  color: #b04a26;
  font-weight: 600;
}

.fc-ready {
  text-align: center;
  outline: none;
}

.fc-ready h2 {
  margin-bottom: 8px;
}

.fc-ready h2 + .btn {
  margin-top: 16px;
}

.fc-ready__confirm {
  margin: 16px 0 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--teal-light);
  color: var(--teal-ink);
  font-weight: 600;
  text-align: left;
}

.fc-ready__confirm.is-error {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.fc-ready__tips {
  margin: 24px 0 8px;
  padding: 0;
  list-style: none;
  counter-reset: t;
  display: grid;
  gap: 14px;
  text-align: left;
  color: var(--text-2);
}

.fc-ready__tips li {
  counter-increment: t;
  display: grid;
  grid-template-columns: 32px 1fr;
  column-gap: 12px;
  align-items: start;
}

.fc-ready__tips li::before {
  content: counter(t);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sun);
  color: var(--on-sun);
  font: 800 1rem/1 var(--font-head);
}

.fc-ready__tips strong {
  color: var(--text);
}

.fc-ready__icon {
  display: block;
  width: 76px;
  margin: 0 auto 12px;
  filter: drop-shadow(0 8px 12px rgba(31, 42, 46, 0.14));
}

.fc-again {
  min-height: 44px;
  margin-top: 8px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--teal-ink);
  font: 600 0.95rem/1 var(--font-body);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.fc-app {
  grid-area: app;
  background: var(--teal-light);
  border-radius: 24px;
  padding: 28px 24px;
}

.fc-app h2 {
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  margin-bottom: 8px;
}

.fc-app > p {
  color: var(--text-2);
  margin: 0 0 22px;
  max-width: 60ch;
}

.fc-app > p.fc-app__small {
  margin: 14px 0 0;
  font-size: 0.9rem;
}

@media (max-width: 520px) {
  .fc-app .btn {
    display: flex;
    width: 100%;
  }
}

@media (min-width: 960px) {
  .fc {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    grid-template-areas: "intro panel" "art panel" "app app";
    column-gap: 56px;
    row-gap: 32px;
    padding-top: 48px;
  }
  .fc-app {
    padding: 40px 48px;
    margin-top: 32px;
  }
}

/* Confirm page */
.fc-done {
  padding-top: 56px;
  padding-bottom: 96px;
}

.fc-done__card {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  background: var(--surface);
  border-radius: 24px;
  padding: 36px 24px;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-soft);
}

.fc-done__card h1 {
  font-size: clamp(2rem, 7vw, 2.6rem);
}

.fc-done__card p {
  color: var(--text-2);
}

/* ---------- The fan of pages (preview) ---------- */

.fc-fan {
  --s: 0.3;
  --pw: 816px;
  --ph: 1056px;
  position: relative;
  height: calc(var(--ph) * var(--s) + 56px);
}

.fc-fan[data-paper="a4"] {
  --pw: 794px;
  --ph: 1123px;
}

.fc-fan .fc-page {
  position: absolute;
  left: 50%;
  top: 28px;
  transform-origin: 50% 0;
  box-shadow: 0 30px 60px -20px rgba(31, 79, 74, 0.45), 0 0 0 1px rgba(31, 79, 74, 0.06);
  transition: transform 0.6s var(--ease-out);
}

.fc-fan .fcp {
  z-index: 3;
  transform: translateX(-50%) scale(var(--s)) rotate(-1.5deg);
}

.fc-fan .fcs {
  z-index: 2;
  transform: translateX(calc(-50% - var(--pw) * var(--s) * 0.42)) translateY(18px) scale(calc(var(--s) * 0.92)) rotate(-8deg);
}

.fc-fan .fcg {
  z-index: 1;
  transform: translateX(calc(-50% + var(--pw) * var(--s) * 0.42)) translateY(18px) scale(calc(var(--s) * 0.92)) rotate(7deg);
}

@media (prefers-reduced-motion: reduce) {
  .fc-fan .fc-page {
    transition: none;
  }
}

/* ---------- The printable pages ---------- */

.fc-page {
  position: relative;
  --ink: #1f2a2e;
  --soft: #5b6b70;
  --teal-p: #2f7d74;
  --deep-p: #1f4f4a;
  --mint: #e6f2f0;
  box-sizing: border-box;
  width: var(--pw);
  height: var(--ph);
  padding: 56px 56px 64px;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--ink);
  font: 500 17px/1.45 var(--font-body);
  overflow: hidden;
  /* Only a backdrop for html-to-image; the page itself is never in the reading order. */
  pointer-events: none;
}

/* While the PDF is made, a full-size copy sits off screen (free-chart.js). */
.fc-render {
  position: fixed;
  left: -12000px;
  top: 0;
}

.fc-render .fc-page {
  position: relative;
  transform: none;
  box-shadow: none;
}

.fc-page h2 {
  font-family: var(--font-head);
  font-weight: 800;
  margin: 0;
  color: var(--deep-p);
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-wrap: balance;
}

.fc-page p {
  margin: 0;
}

.fc-brand {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 700 14px/1 var(--font-head);
  color: var(--soft);
}

.fc-page .fc-brand svg {
  width: 20px;
  height: 20px;
}

/* Page 1: the chart */
.fcp::before {
  content: "";
  position: absolute;
  inset: 22px;
  border: 3px solid var(--teal-p);
  border-radius: 36px;
}

.fcp__corner {
  position: absolute;
  width: 96px;
  height: 96px;
  top: 12px;
}

.fcp__corner--tl {
  left: 14px;
  transform: rotate(-14deg);
}

.fcp__corner--tr {
  right: 14px;
  transform: rotate(12deg);
}

.fcp__head {
  position: relative;
  text-align: center;
  padding: 6px 90px 0;
}

.fcp__head h2 {
  font-size: 58px;
}

.fcp__head h2 span {
  color: var(--teal-p);
}

.fcp__head p {
  margin-top: 10px;
  font: 800 22px/1.2 var(--font-head);
  color: var(--soft);
}

.fcp__grid {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  gap: 10px;
  margin: 26px 8px 20px;
}

.fcp__row {
  display: grid;
  grid-template-columns: 88px repeat(6, 1fr);
  gap: 10px;
}

.fcp__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: var(--mint);
  color: var(--deep-p);
}

.fcp__day b {
  font: 800 13px/1 var(--font-head);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fcp__day strong {
  font: 800 34px/1 var(--font-head);
}

.fcp__cell {
  display: grid;
  place-items: center;
  border: 2.5px dashed #c9d4d1;
  border-radius: 18px;
}

.fcp__cell svg {
  width: 38%;
  fill: none;
  stroke: #dce5e2;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.fcp__foot {
  position: relative;
  display: flex;
  gap: 16px;
  margin: 0 8px;
}

.fcp__prize {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  border-radius: 22px;
  border: 2.5px solid #f2b544;
  background: #fff6df;
}

.fcp__prize svg {
  width: 48px;
  height: 48px;
  color: #b07408;
}

.fcp__prize div {
  flex: 1;
}

.fcp__prize span {
  font: 800 21px/1.2 var(--font-head);
  color: var(--deep-p);
}

.fcp__prize i {
  display: block;
  height: 36px;
  border-bottom: 2px dotted #b9a26a;
}

.fcp__did {
  width: 136px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  background: var(--mint);
}

.fcp__did img {
  width: 64px;
  height: 64px;
}

.fcp__did span {
  font: 800 20px/1.1 var(--font-head);
  color: var(--deep-p);
}

/* Page 2: stickers to cut out */
.fcs__head {
  text-align: center;
  margin-bottom: 22px;
}

.fcs__head h2 {
  font-size: 42px;
}

.fcs__head p {
  margin-top: 8px;
  color: var(--soft);
}

.fcs__grid {
  display: grid;
  grid-template-columns: repeat(8, 84px);
  grid-auto-rows: 84px;
  justify-content: center;
}

.fcs__tile {
  display: grid;
  place-items: center;
  border-right: 1.5px dashed #b9c6c3;
  border-bottom: 1.5px dashed #b9c6c3;
}

.fcs__tile:nth-child(8n + 1) {
  border-left: 1.5px dashed #b9c6c3;
}

.fcs__tile:nth-child(-n + 8) {
  border-top: 1.5px dashed #b9c6c3;
}

.fcs__tile img {
  width: 66px;
  height: 66px;
}

/* Page 3: the guide for grown-ups */
.fcg__kicker {
  font: 800 14px/1 var(--font-head);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal-p);
  margin-bottom: 12px !important;
}

.fcg__head h2 {
  font-size: 44px;
}

.fcg__head > p:last-child {
  margin-top: 12px;
  font-size: 19px;
  color: var(--soft);
  max-width: 34em;
}

.fcg__steps {
  list-style: none;
  margin: 30px 0 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.fcg__steps li {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 16px;
  align-items: start;
}

.fcg__num {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--teal-p);
  color: #fff;
  font: 800 22px/1 var(--font-head);
}

.fcg__steps strong {
  font: 800 21px/1.25 var(--font-head);
  color: var(--deep-p);
}

.fcg__steps p {
  margin-top: 2px;
  color: var(--soft);
}

.fcg__say {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 28px;
}

.fcg__say > div {
  border-radius: 20px;
  padding: 18px 22px;
}

.fcg__say b {
  display: block;
  font: 800 13px/1 var(--font-head);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.fcg__say q {
  font: 800 21px/1.25 var(--font-head);
  quotes: "\201C" "\201D";
}

.fcg__yes {
  background: var(--mint);
}

.fcg__yes b {
  color: var(--teal-p);
}

.fcg__no {
  background: #fcede8;
  color: #8f3f27;
}

.fcg__no q {
  text-decoration: line-through;
  text-decoration-color: rgba(143, 63, 39, 0.45);
  text-decoration-thickness: 2px;
}

.fcg__prize {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
}

.fcg__prize img {
  width: 60px;
  height: 60px;
  flex: none;
}

.fcg__prize strong {
  color: var(--deep-p);
}

.fcg__plug {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-radius: 20px;
  background: #f4f7f6;
  font-size: 15px;
  color: var(--soft);
}

.fcg__plug svg {
  width: 48px;
  height: 48px;
  flex: none;
}

.fcg__plug strong {
  color: var(--deep-p);
}
