@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/PlayfairDisplay-600.woff2") format("woff2");
}
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/PlayfairDisplay-700.woff2") format("woff2");
}

:root {
  /* Cool, calm wedding palette (human-acceptance revision, 2026-08-16) --
     moved off the earlier warm beige/brown treatment toward a cool ivory
     base with a muted sage/eucalyptus accent. */
  --ink: #2b302c;
  --muted: #6d756e;
  --rule: #cfd6cd;
  --border: #94a196;
  --cream: #f4f6f2;
  --card: #ffffff;
  /* Productionisation Stage 1, item 15: darkened from the original #6f8a76
     (measured contrast ~3.77:1 against white button text -- fails WCAG AA's
     4.5:1 requirement for the primary CTA's actual text size, ~16.8px/600-
     weight, which doesn't qualify for the "large text" 3:1 exemption).
     #607766 is the smallest lightness reduction (same hue/saturation, HSL
     L 0.488 -> 0.42) that clears AA with a small safety margin (~4.88:1) --
     same green family, not a redesign. --accent-dark (hover state, already
     ~8.2:1) is unchanged. */
  --accent: #607766;
  --accent-dark: #4f6656;
  --danger: #a13f38;
  --radius: 10px;
  --max-width: 720px;
  --max-width-wide: 1120px;
  --font-serif: "Playfair Display", Georgia, "Times New Roman", Times, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

#app {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 20px 16px 48px;
  width: 100%;
}

/* Every screen except the landing page keeps the original comfortable
   reading width, centered within the wider #app shell -- only the landing
   hero/proof composition needs the extra width. */
.screen:not(.landing) {
  max-width: var(--max-width);
  margin: 0 auto;
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
}

h1 {
  font-size: 1.6rem;
  margin: 0 0 8px;
}

.screen-sub {
  color: var(--muted);
  margin: 0 0 20px;
}

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

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  min-height: 44px;
}

textarea {
  resize: vertical;
}

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

.field-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.field-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}

.field-error {
  color: var(--danger);
  font-size: 0.9rem;
  min-height: 1.1em;
  margin: 4px 0 8px;
}
.field-error:empty {
  margin: 0;
}

input.invalid,
textarea.invalid {
  border-color: var(--danger);
  background: #fdf4f3;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(79, 102, 86, 0.55);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
}
.btn-primary:disabled {
  background: #d3dad4;
  color: #8b9389;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
}

.btn-large {
  width: 100%;
  font-size: 1.05rem;
  padding: 14px 20px;
}

.btn-text,
.btn-link {
  background: none;
  border: none;
  color: var(--accent-dark);
  padding: 6px 2px;
  min-height: 40px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
}

.btn-danger {
  color: var(--danger);
}

.back-link {
  display: inline-block;
  margin-bottom: 12px;
}

.return-to-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--accent-dark);
}

/* ===== Landing (Test 1 marketing redesign, human-acceptance revision 2026-08-16) ===== */

.hero-shell {
  padding: 20px 0 8px;
  max-width: 640px;
  margin: 0 auto;
}
.landing-headline {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 2.5rem;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.landing-subhead {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 18px;
  max-width: 46ch;
}

/* Hero photo slot: gracefully collapses to a single centered column when
   no asset is present at /images/hero-reception.webp (see landing.js's
   onerror handler) -- never shows a broken-image icon or placeholder box
   to a real customer. Mobile crop is deliberately shallow (supporting
   visual proof, not a co-equal element with the same relative weight as
   the desktop treatment) so the primary CTA stays close to the first
   viewport (final acceptance revision, 2026-08-17). */
.hero-visual {
  margin: 14px 0 0;
}
.hero-photo {
  display: block;
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  object-position: center 35%;
  border-radius: 16px;
  box-shadow: 0 18px 40px -20px rgba(43, 48, 44, 0.45);
}
.hero-shell.no-photo .hero-visual {
  display: none;
}

.hero-form {
  margin-top: 16px;
  max-width: 520px;
}
/* Name fields sit side by side by default (flex-wrap, not a breakpoint) --
   at any modern phone width (~360px+) two ~140px fields comfortably fit
   side by side, saving a full field's height of vertical space versus
   stacking; only wraps to stacked on genuinely narrow/legacy widths. */
.hero-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.hero-form-row .field {
  flex: 1 1 140px;
  margin-bottom: 10px;
}
.hero-form .field {
  margin-bottom: 10px;
}
.hero-form .btn-large {
  margin-top: 4px;
}
.landing-reassurance {
  color: var(--muted);
  font-size: 0.84rem;
  margin: 14px 0 0;
  text-align: center;
}
.landing-note {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 8px 0 0;
  text-align: center;
}

.landing section {
  padding: 32px 0;
  border-top: 1px solid var(--rule);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.landing section h2 {
  text-align: center;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.4rem;
  margin: 0 0 20px;
}

/* Product proof: three equal-sized previews -- "three complete
   personalised activities," not one primary page with two secondary ones
   (final acceptance revision, 2026-08-17; replaces the earlier one-large/
   two-small composition). Needs to override ".landing section"'s 640px
   cap, hence the more specific selector. */
.landing section.proof-section {
  max-width: var(--max-width-wide);
}
.proof-composition {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: 420px;
  margin: 0 auto;
}
.proof-composition figcaption {
  text-align: center;
  margin-top: 8px;
  font-weight: 600;
  color: var(--accent-dark);
  font-size: 0.9rem;
}
.proof-item .preview-page-frame {
  box-shadow: 0 16px 32px -18px rgba(43, 48, 44, 0.4);
}
.proof-note {
  text-align: center;
  margin: 24px 0 0;
}

@media (min-width: 900px) {
  .proof-composition {
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
    gap: 32px;
    /* Fill the section's own (wide) width instead of capping at 900px --
       final acceptance follow-up (2026-08-17): desktop/tablet previews
       were too small to inspect. Mobile is untouched (separate rule above,
       this block only applies at >=900px). */
    max-width: none;
  }
}

/* How it works: deliberately lightweight -- three short lines, not a
   bordered feature block. */
.how-it-works h2 {
  margin-bottom: 16px;
}
.how-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 40ch;
  margin-left: auto;
  margin-right: auto;
}
.how-step {
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.how-step-number {
  flex: none;
  color: var(--accent-dark);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
}
.how-step-text {
  color: var(--ink);
}

@media (min-width: 900px) {
  .hero-shell {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    column-gap: 56px;
    align-items: start;
    padding: 48px 0 20px;
    position: relative;
  }
  .hero-shell > * {
    grid-column: 1;
  }
  /* Positioned absolutely and taken out of grid row-flow entirely (a
     row-spanning grid item that DOES participate in row-track sizing was
     tried first and empirically pinned the photo flush to the headline
     with a large dead gap opening up before the next item -- the opposite
     of "feels integrated"). A fixed `top` nudges it down from the
     headline's top edge so it reads as centered against the whole text
     block rather than floating beside just the headline -- a hand-tuned,
     modest offset (not a dynamic recalculation) is intentional here, since
     the brief asked for a subtle alignment fix, not a new layout system. */
  .hero-shell .hero-visual {
    grid-column: 2;
    position: absolute;
    top: 110px;
    width: 100%;
    margin: 0;
  }
  .hero-shell.no-photo {
    grid-template-columns: 1fr;
    max-width: 960px;
  }
  .hero-shell {
    max-width: var(--max-width-wide);
  }
  .landing-headline {
    font-size: 3.4rem;
  }
  .hero-photo {
    max-height: none;
    height: 460px;
  }
  .landing-reassurance,
  .landing-note {
    text-align: left;
  }
}

/* Progress */
.progress-banner {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
  font-weight: 600;
}
.progress-done {
  border-color: var(--accent);
  color: var(--accent-dark);
}
.progress-almost {
  border-color: var(--rule);
  color: var(--ink);
}
.progress-note {
  font-weight: 400;
  color: var(--muted);
}
.progress-track {
  height: 8px;
  background: #e4e9e2;
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
}

/* Prompt list */
.prompt-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}
.prompt-row {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.prompt-row.answered {
  border-color: var(--accent);
}
.prompt-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  text-align: left;
  padding: 12px 14px;
  min-height: 48px;
  cursor: pointer;
}
.prompt-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.prompt-check {
  flex: none;
  width: 1.4em;
  color: var(--accent);
  font-weight: 700;
}
.prompt-text-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.prompt-text {
  font-weight: 600;
}
.prompt-answer-preview {
  color: var(--muted);
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor {
  padding: 4px 14px 16px;
  border-top: 1px solid var(--rule);
}
.editor-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* Review list */
.review-list h2 {
  font-size: 1.1rem;
}
.review-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.review-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.review-card-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.review-card-text {
  min-width: 0;
}
.review-prompt {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.review-answer {
  margin: 2px 0 0;
  font-weight: 600;
  word-break: break-word;
}
.review-card-actions {
  display: flex;
  gap: 10px;
  flex: none;
}
.empty-hint {
  color: var(--muted);
}

/* Colour picker */
.color-picker {
  margin-bottom: 16px;
}
.color-select {
  max-width: 280px;
}

/* Generate bar */
.generate-bar {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--cream) 70%, rgba(244, 246, 242, 0));
  padding-top: 16px;
  margin-top: 8px;
}
.generate-hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  margin: 8px 0 0;
}

.error-banner {
  background: #fbeceb;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
  color: #6f231e;
}
.error-banner-title {
  margin: 0 0 6px;
  font-weight: 600;
}
.error-banner ul {
  margin: 0;
  padding-left: 20px;
}

/* Generating */
.generating {
  text-align: center;
  padding: 60px 12px;
}
.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--rule);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Preview */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 20px 0;
}
.activity-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 16px;
}
.activity-card h3 {
  margin: 0 0 10px;
}

/*
 * The preview page itself is a single rasterized, pre-watermarked image
 * from the canonical PDF (src/server/previewRaster.ts) -- there is no
 * HTML/CSS reconstruction of puzzle content here. The frame's aspect-ratio
 * is set inline per page from the server-reported pixel dimensions, so all
 * three pages keep the exact proportions of the printed pack and scale
 * responsively without cropping or distortion.
 */
.preview-page-frame {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}
.preview-page-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview-actions-secondary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.preview-actions-secondary .btn {
  flex: 1 1 auto;
}
.checkout-msg {
  text-align: center;
  color: var(--accent-dark);
  font-weight: 600;
}
.checkout-msg.hidden {
  display: none;
}

/* Bottom-of-preview paid offer -- deliberately the last thing on the
   preview screen, after all three pages are inspectable above it. Kept
   compact: no long sales copy between this and Checkout. A visually
   stronger treatment than a plain bordered card, so it reads as the
   natural culmination of the preview rather than an afterthought. */
.offer-block {
  text-align: center;
  background: linear-gradient(180deg, #eef2ec 0%, var(--card) 55%);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 32px 20px;
  margin-top: 32px;
  box-shadow: 0 20px 44px -28px rgba(43, 48, 44, 0.5);
}
.offer-block h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin: 0 0 6px;
}
.offer-kicker {
  color: var(--accent-dark);
  font-weight: 600;
  margin: 0 0 12px;
}
.offer-body {
  color: var(--muted);
  max-width: 46ch;
  margin: 0 auto 16px;
}
.offer-price {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin: 0 0 16px;
}
.offer-block .btn-large {
  max-width: 420px;
  margin: 0 auto;
}
.offer-includes {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 16px 0 0;
}

/* Fulfilment (Milestone 5) */
.fulfilment-downloads {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.fulfilment-thanks {
  margin-top: 28px;
  color: var(--ink);
}

/* Post-purchase feedback (Post-Purchase Feedback Addition): deliberately
   quiet/secondary -- smaller text, muted sentiment buttons (not
   btn-primary), a top rule to visually separate it from the dominant
   downloads above. Never competes with the download buttons for attention. */
.post-purchase {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
.post-purchase h2 {
  font-size: 1rem;
  color: var(--muted);
  margin: 0 0 10px;
}
.sentiment-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sentiment-btn {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
}
.sentiment-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.feedback-comment-block {
  margin-top: 12px;
}
.feedback-comment-block.hidden {
  display: none;
}
.feedback-comment {
  min-height: 60px;
}
.feedback-thanks {
  color: var(--muted);
  font-weight: 600;
}

.confirm-dialog {
  border: none;
  border-radius: var(--radius);
  padding: 20px;
  width: min(92vw, 420px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}
.confirm-dialog::backdrop {
  background: rgba(43, 48, 44, 0.5);
}
.confirm-dialog h3 {
  margin: 0 0 10px;
}
.confirm-dialog p {
  color: var(--muted);
  margin: 0 0 18px;
}
.confirm-dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (min-width: 480px) {
  .confirm-dialog-actions {
    flex-direction: row-reverse;
  }
  .confirm-dialog-actions .btn {
    flex: 1 1 auto;
  }
}

@media (min-width: 640px) {
  #app {
    padding: 32px 16px 64px;
  }
  h1 {
    font-size: 2rem;
  }
}

/* Productionisation Stage 1, item 13: minimal public trust/business surface. */
.site-footer {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 20px 16px 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  font-size: 0.85rem;
}
/* Hidden only on the generating/loading screen (web/public/js/main.js's
   rerender()) -- that screen must stay distraction-free while the customer
   waits for their personalised preview. */
.site-footer.hidden {
  display: none;
}
.site-footer a {
  color: var(--muted);
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.legal-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 16px 48px;
}
.legal-page h2 {
  font-size: 1.15rem;
  margin: 28px 0 8px;
}
.legal-page p {
  margin: 0 0 12px;
}
.legal-page .placeholder {
  background: #fef3c4;
  color: var(--ink);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.92em;
}
.legal-footnote {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 24px;
}
