/* Colour Our Story — calm, single warm colour design. Big friendly controls. */
:root {
  --warm: #b3541e;          /* warm terracotta */
  --warm-dark: #8f4215;
  --cream: #fdf6ec;
  --paper: #fffdf8;
  --ink: #3d2b1f;
  --soft: #f3e3cf;
  --line: #e4cdb0;
  --ok: #2e7d32;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.45;
}

.site-header {
  background: var(--warm);
  color: #fff;
  text-align: center;
  padding: 20px 12px 14px;
}
.brand { font-size: 2rem; font-weight: 800; letter-spacing: .5px; }
.tagline { font-size: 1.05rem; opacity: .92; }

.privacy-strip {
  background: var(--soft);
  border-bottom: 2px solid var(--line);
  padding: 10px 16px;
  text-align: center;
}
.privacy-strip p { margin: 0 auto; max-width: 860px; font-size: .98rem; }

/* Step bar */
.step-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center;
  padding: 12px;
  position: sticky; top: 0; z-index: 20;
  background: var(--cream);
  border-bottom: 2px solid var(--line);
}
.step-tab {
  min-height: 56px;
  padding: 8px 16px;
  font-size: 1.05rem; font-weight: 700;
  border: 3px solid var(--warm);
  border-radius: 999px;
  background: var(--paper);
  color: var(--warm-dark);
  cursor: pointer;
}
.step-tab.is-active { background: var(--warm); color: #fff; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--soft); color: var(--warm-dark);
  margin-right: 6px; font-weight: 800;
}
.step-tab.is-active .step-num { background: #fff; }

main { max-width: 920px; margin: 0 auto; padding: 16px 12px 40px; }

.step-panel { display: none; }
.step-panel.is-active { display: block; }
.step-panel h1 { font-size: 1.6rem; color: var(--warm-dark); }

.card {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin: 16px 0;
}
.card h2 { margin-top: 0; color: var(--warm-dark); }
.card h3 { color: var(--warm-dark); }

.tips-card ul { margin: 8px 0; padding-left: 22px; }
.tips-card li { margin: 6px 0; font-size: 1.02rem; }

.big-btn {
  min-height: 56px;
  padding: 10px 22px;
  font-size: 1.1rem; font-weight: 700;
  border: 3px solid var(--warm);
  border-radius: 999px;
  background: var(--paper);
  color: var(--warm-dark);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  text-align: center;
}
.big-btn.primary { background: var(--warm); color: #fff; }
.big-btn.small { min-height: 56px; font-size: 1rem; padding: 8px 16px; }
.big-btn.danger { border-color: #b3261e; color: #b3261e; }
.big-btn:disabled { opacity: .45; cursor: not-allowed; }
.big-btn.locked::after { content: " 🔒"; }

.button-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; align-items: center; }
.button-row.wrap { flex-wrap: wrap; }

.nav-row { display: flex; justify-content: space-between; gap: 12px; margin: 20px 0; flex-wrap: wrap; }

.drop-zone {
  border: 3px dashed var(--warm);
  border-radius: var(--radius);
  padding: 28px 12px;
  text-align: center;
  background: var(--cream);
}
.drop-zone.drag-over { background: var(--soft); }
.drop-big { font-size: 1.4rem; font-weight: 800; margin: 0 0 4px; }

.photo-count { font-weight: 700; }

.thumb-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.thumb {
  width: 96px; height: 96px; object-fit: cover;
  border-radius: 12px; border: 3px solid var(--line);
  cursor: pointer; background: #fff;
}
.thumb.selected { border-color: var(--warm); }

.mode-picker, .book-picker, .style-picker {
  display: flex; flex-wrap: wrap; gap: 12px;
}
.mode-option, .book-option, .style-option {
  flex: 1 1 220px;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  background: var(--paper);
  display: block;
  min-height: 56px;
}
.mode-option input, .book-option input, .style-option input { margin-right: 8px; transform: scale(1.4); }
.mode-option:has(input:checked), .book-option:has(input:checked), .style-option:has(input:checked) {
  border-color: var(--warm); background: var(--soft);
}
.mode-title, .book-title { display: block; font-size: 1.2rem; font-weight: 800; }
.mode-desc, .book-desc { display: block; margin-top: 4px; }
.book-price { display: block; font-size: 1.5rem; font-weight: 800; color: var(--warm); margin: 4px 0; }
.style-option { flex: 1 1 150px; font-size: 1.05rem; font-weight: 700; text-align: center; }

.field { display: block; margin: 12px 0; font-weight: 700; }
.field span { display: block; margin-bottom: 6px; }
.field input[type="text"], .field select {
  width: 100%;
  min-height: 56px;
  font-size: 1.05rem;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}

.fine-note { font-size: .95rem; }
.fine-print { font-size: .88rem; }

/* Page display + watermark */
.page-frame {
  position: relative;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  max-width: 640px;
  margin: 0 auto;
}
.page-frame img, .page-frame canvas {
  display: block; width: 100%; height: auto;
}
.watermark {
  position: absolute; inset: 0;
  pointer-events: none;
  display: none;
}
body.unpaid .watermark { display: block; }
body.unpaid .page-frame img, body.unpaid .page-frame canvas {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.wm-note { text-align: center; font-weight: 700; color: var(--warm-dark); display: none; }
body.unpaid .wm-note { display: block; }

.page-status { text-align: center; font-weight: 700; min-height: 1.4em; }
.page-status.error { color: #b3261e; }
.page-status.ok { color: var(--ok); }

.cover-picker { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.cover-choice {
  width: 104px; cursor: pointer; text-align: center; font-weight: 700; font-size: .9rem;
}
.cover-choice canvas {
  width: 104px; height: 138px; border: 3px solid var(--line); border-radius: 8px; background: #fff;
}
.cover-choice.selected canvas { border-color: var(--warm); }

.story-preview {
  background: var(--cream);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  white-space: pre-wrap;
}

.classroom-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.mini-card { background: var(--cream); border: 2px solid var(--line); border-radius: 12px; padding: 12px; }
.mini-card h3 { margin-top: 0; font-size: 1.05rem; }

.book-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .book-preview { grid-template-columns: 1fr; } }

.paywall-summary { font-size: 1.1rem; font-weight: 700; }

.site-footer {
  background: var(--soft);
  border-top: 2px solid var(--line);
  padding: 20px 16px 32px;
  text-align: center;
}
.site-footer p { max-width: 860px; margin: 10px auto; }
.footer-brand { font-weight: 800; font-size: 1.1rem; color: var(--warm-dark); }

/* Crop modal */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(40, 25, 15, .6);
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
}
.modal[hidden] { display: none; }
.modal-box {
  background: var(--paper); border-radius: var(--radius);
  padding: 18px; max-width: 680px; width: 100%;
  max-height: 92vh; overflow: auto;
}
.crop-stage { position: relative; margin: 0 auto; max-width: 560px; }
.crop-stage img { display: block; width: 100%; height: auto; }
.crop-box {
  position: absolute;
  border: 3px solid var(--warm);
  background: rgba(179, 84, 30, .12);
  cursor: move;
  touch-action: none;
}
.crop-handle {
  position: absolute; right: -14px; bottom: -14px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--warm); border: 3px solid #fff;
  cursor: nwse-resize; touch-action: none;
}
