/* ============================================================
   BECOMING SOMEONE NEW — Story Submission Wizard
   Stylesheet

   Colors and fonts below are matched to the homepage
   (Cormorant Garamond + Inter, sage green accent, cream bg).
   Change the :root variables if the homepage palette changes.
   ============================================================ */

:root{
  --bg: #f7f4ef;              /* matches homepage --bg */
  --ink: #2d2d2d;              /* matches homepage --text */
  --ink-muted: #756f68;
  --accent: #7b9278;           /* matches homepage --accent (sage green) */
  --accent-dark: #62755f;
  --card-bg: #FFFFFF;
  --border: #E6E1D8;
  --dot-filled: #7b9278;
  --dot-empty: #DCD6C9;
  --shadow: 0 20px 60px rgba(45,45,45,0.08);

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0;height:100%}
body{
  font-family:var(--font-sans);
  background:var(--bg);
  color:var(--ink);
  overflow:hidden; /* the wizard is a single full-screen experience */
}

/* FIX: the browser's built-in [hidden] rule (display:none) is only a
   User-Agent-origin style — any author CSS that sets `display` on the
   same element (e.g. `.restore-banner{display:flex}` below) will win
   the cascade even at equal specificity, because author styles beat
   UA styles regardless. That silently broke "hidden" elements like
   the restore-draft banner, the back button, and the photo-upload
   reveal — JS correctly set the `hidden` attribute, but they stayed
   visually visible anyway. This rule forces `hidden` to always win. */
[hidden]{display:none !important}

/* ---------- Shell / layout ---------- */

.wizard-shell{
  position:relative;
  width:100%;
  height:100vh;
  height:100dvh;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}

.card-stack{
  position:relative;
  width:100%;
  height:100%;
}

/* Each card fills the screen and is positioned absolutely so we can
   slide between them. Only .active (and the card mid-transition) are
   visible at any time. */
.card{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:2rem 1.5rem;
  opacity:0;
  pointer-events:none;
  transform:translateX(40px);
  transition:transform 0.5s cubic-bezier(.22,.61,.36,1), opacity 0.4s ease;
  overflow-y:auto;
}
.card.active{
  opacity:1;
  pointer-events:auto;
  transform:translateX(0);
}
.card.exit-left{
  opacity:0;
  transform:translateX(-40px);
}
.card.enter-from-right{
  transform:translateX(40px);
}

.card-inner{
  width:100%;
  max-width:560px;
  background:var(--card-bg);
  border:1px solid var(--border);
  border-radius:22px;
  box-shadow:var(--shadow);
  padding:3rem 2.75rem;
  margin:auto;
}

.intro-inner{
  text-align:center;
}

/* ---------- Typography ---------- */

.eyebrow{
  font-family:var(--font-sans);
  font-size:13px;
  letter-spacing:0.14em;
  text-transform:uppercase;
  color:var(--accent);
  margin:0 0 0.9rem;
  font-weight:600;
}

h1{
  font-family:var(--font-serif);
  font-size:clamp(1.9rem, 4vw, 2.6rem);
  font-weight:600;
  line-height:1.25;
  margin:0 0 1.1rem;
  color:var(--ink);
}

h2{
  font-family:var(--font-serif);
  font-size:clamp(1.5rem, 3.4vw, 1.9rem);
  font-weight:600;
  line-height:1.3;
  margin:0 0 1.4rem;
  color:var(--ink);
}

.lede{
  font-size:16px;
  color:var(--ink-muted);
  margin:0 0 0.5rem;
  line-height:1.6;
}

.prompt-line{
  font-size:15px;
  color:var(--ink-muted);
  margin:0 0 1.3rem;
  line-height:1.6;
}
.prompt-line.muted{
  font-size:13.5px;
}

.field-label{
  font-weight:600;
  color:var(--ink);
  margin-bottom:0.5rem;
}

.heart{
  font-size:28px;
  margin-top:1.2rem;
}

/* ---------- Buttons ---------- */

.btn-primary{
  display:inline-block;
  margin-top:1.8rem;
  padding:0.85rem 1.8rem;
  border:none;
  border-radius:999px;
  background:var(--accent);
  color:#fff;
  font-size:15px;
  font-weight:600;
  cursor:pointer;
  transition:background 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}
.btn-primary:hover:not(:disabled){background:var(--accent-dark)}
.btn-primary:active:not(:disabled){transform:scale(0.98)}
.btn-primary:disabled{
  background:var(--dot-empty);
  color:#A39C8E;
  cursor:not-allowed;
}
.btn-begin{margin-top:2.2rem}

.back-btn,
.home-btn{
  position:fixed;
  top:1.4rem;
  z-index:20;
  width:38px;
  height:38px;
  border-radius:50%;
  border:1px solid var(--border);
  background:var(--card-bg);
  color:var(--ink-muted);
  font-size:19px;
  line-height:1;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:opacity 0.2s ease, background 0.2s ease;
  text-decoration:none;
}
.back-btn{left:1.4rem}
.home-btn{right:1.4rem}
.back-btn:hover,
.home-btn:hover{background:var(--border)}

/* ---------- Progress dots ----------
   Filled = a solid circle. Remaining = a short flat dash.
   No numbers, no "step X of Y" — just a sense of motion. */

.progress-dots{
  position:fixed;
  top:1.6rem;
  left:50%;
  transform:translateX(-50%);
  display:flex;
  align-items:center;
  gap:6px;
  z-index:20;
  opacity:0;
  transition:opacity 0.3s ease;
  pointer-events:none;
}
.progress-dots.visible{opacity:1}

.dot{
  height:7px;
  border-radius:999px;
  background:var(--dot-empty);
  width:16px;
  transition:width 0.3s ease, background 0.3s ease, border-radius 0.3s ease;
}
.dot.filled{
  background:var(--dot-filled);
  width:7px;
  border-radius:50%;
}

/* ---------- Form elements ---------- */

.options{
  display:flex;
  flex-direction:column;
  gap:0.6rem;
  margin-bottom:0.5rem;
}

.option{
  display:flex;
  align-items:center;
  gap:0.75rem;
  padding:0.75rem 1rem;
  border:1.5px solid var(--border);
  border-radius:12px;
  cursor:pointer;
  font-size:15px;
  transition:border-color 0.15s ease, background 0.15s ease;
}
.option:hover{border-color:var(--accent)}
.option input{position:absolute;opacity:0;width:0;height:0}

.radio-mark{
  width:18px;
  height:18px;
  border-radius:50%;
  border:1.5px solid var(--dot-empty);
  flex-shrink:0;
  position:relative;
  transition:border-color 0.15s ease;
}
.option input:checked ~ .radio-mark{
  border-color:var(--accent);
}
.option input:checked ~ .radio-mark::after{
  content:"";
  position:absolute;
  inset:3px;
  border-radius:50%;
  background:var(--accent);
}
.option:has(input:checked){
  border-color:var(--accent);
  background:#F2F5F1;
}

.checklist{
  display:flex;
  flex-direction:column;
  gap:0.75rem;
  margin-bottom:0.5rem;
}
.checkbox{
  display:flex;
  align-items:center;
  gap:0.75rem;
  font-size:15px;
  cursor:pointer;
}
.checkbox input{position:absolute;opacity:0;width:0;height:0}
.check-mark{
  width:19px;
  height:19px;
  border-radius:6px;
  border:1.5px solid var(--dot-empty);
  flex-shrink:0;
  position:relative;
  transition:border-color 0.15s ease, background 0.15s ease;
}
.checkbox input:checked ~ .check-mark{
  background:var(--accent);
  border-color:var(--accent);
}
.checkbox input:checked ~ .check-mark::after{
  content:"";
  position:absolute;
  left:6px;
  top:2px;
  width:5px;
  height:10px;
  border:solid #fff;
  border-width:0 2px 2px 0;
  transform:rotate(45deg);
}

.form-error{
  background:#FBEAEA;
  border:1px solid #E3B3B0;
  color:#9C3A34;
  font-size:13.5px;
  border-radius:10px;
  padding:0.7rem 0.9rem;
  margin:0.6rem 0 0;
  line-height:1.5;
}

.text-input,
.sentence-input,
.story-input,
.reflection-input{
  width:100%;
  font-family:var(--font-sans);
  font-size:16px;
  color:var(--ink);
  background:var(--bg);
  border:1.5px solid var(--border);
  border-radius:12px;
  padding:0.85rem 1rem;
  resize:vertical;
  transition:border-color 0.15s ease;
  margin-bottom:1rem;
}
.text-input:focus,
.sentence-input:focus,
.story-input:focus,
.reflection-input:focus{
  outline:none;
  border-color:var(--accent);
}

.sentence-input{font-family:var(--font-serif);font-size:19px}
.reflection-input{font-family:var(--font-serif);font-size:18px}

.story-input{
  min-height:30vh;
  font-size:16px;
  line-height:1.7;
}

.inline-reveal{
  margin-top:0.9rem;
}

.examples{
  margin-top:1.4rem;
  padding-top:1.1rem;
  border-top:1px solid var(--border);
}
.examples-label{
  font-size:11px;
  letter-spacing:0.1em;
  text-transform:uppercase;
  color:var(--ink-muted);
  margin:0 0 0.6rem;
}
.example{
  font-family:var(--font-serif);
  font-style:italic;
  color:var(--ink-muted);
  font-size:15px;
  margin:0 0 0.4rem;
}

.file-reveal{
  display:flex;
  flex-direction:column;
  gap:0.5rem;
}
.file-label{
  display:inline-block;
  align-self:flex-start;
  padding:0.6rem 1.2rem;
  border-radius:999px;
  border:1.5px solid var(--accent);
  color:var(--accent);
  font-size:14px;
  font-weight:600;
  cursor:pointer;
}
.file-reveal input[type="file"]{display:none}
.file-name{font-size:13px;color:var(--ink-muted);margin:0}

/* ---------- Restore-draft banner ---------- */

.restore-banner{
  position:fixed;
  top:0;
  left:0;
  right:0;
  z-index:30;
  background:var(--ink);
  color:#fff;
  font-size:13.5px;
  padding:0.7rem 1rem;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:1rem;
  flex-wrap:wrap;
  text-align:center;
}
.link-btn{
  background:none;
  border:none;
  color:#B9CFB5;
  font-weight:600;
  font-size:13.5px;
  cursor:pointer;
  text-decoration:underline;
}
.link-btn.muted{color:#C9C3B7}

/* ---------- Responsive ---------- */

@media (max-width:640px){
  .card{padding:1.25rem 1rem}
  .card-inner{padding:2.1rem 1.5rem;border-radius:18px}
  .story-input{min-height:26vh}
  .progress-dots{top:1.1rem}
  .back-btn{top:1rem;left:1rem;width:34px;height:34px}
  .home-btn{top:1rem;right:1rem;width:34px;height:34px}
}

@media (max-height:640px){
  .card-inner{padding:1.6rem 1.75rem}
  .story-input{min-height:22vh}
}
