/* Seraya Aeterna — shared visual theme
   Palette: parchment cream + midnight denim blue + dusty rose + warm gold.
   NOTE: swap these tokens for exact colors once real brand assets are supplied. */

:root {
  --cream: #f3ecdf;
  --parchment: #ece2cf;
  --midnight: #1c2440;
  --midnight-deep: #12172c;
  --dusty-rose: #c96a6a;
  --gold: #e8c477;
  --ink: #2b2620;
  --muted: #7a7466;
  color-scheme: light;
}

* { box-sizing: border-box; }

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

.handwritten {
  font-family: "Segoe Script", "Bradley Hand", cursive;
  font-weight: 400;
}

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

/* ---------- Flipbook shell ---------- */

.flipbook {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: min(85vh, 760px);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
  background: var(--cream);
}

.flipbook-track {
  display: flex;
  height: calc(100% - 56px);
  transition: transform 0.45s cubic-bezier(.65,0,.35,1);
}

.page {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

.flipbook-nav {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: var(--parchment);
}

.nav-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--midnight);
  color: var(--cream);
  font-size: 1.3rem;
  cursor: pointer;
}
.nav-btn:disabled { opacity: 0.3; cursor: default; }

.flipbook-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 60%; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #d8cdb3; cursor: pointer; }
.dot.is-active { background: var(--dusty-rose); }

/* ---------- Cover ---------- */
.page--cover { background: linear-gradient(180deg, var(--cream), var(--parchment)); }
.envelope-deco { font-size: 2rem; }
.polaroid { background: #fff; padding: 10px 10px 24px; box-shadow: 0 8px 20px rgba(0,0,0,0.2); transform: rotate(-3deg); width: 70%; max-width: 220px; }
.polaroid img { width: 100%; display: block; }
.photo-placeholder {
  aspect-ratio: 4/5;
  width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #eee3cf; color: #a89a78; font-size: 2rem; gap: 6px;
  border: 1px dashed #c9b98d;
}
.photo-placeholder span { font-size: 0.7rem; }
h1.handwritten { font-size: 2.2rem; margin: 4px 0; color: var(--midnight); }
.subtitle { font-style: italic; color: var(--muted); }
.scroll-hint { font-size: 0.75rem; color: var(--muted); margin-top: auto; }

/* ---------- PIN gate ---------- */
.page--pin { background: radial-gradient(circle at 50% 20%, #2a3560, var(--midnight-deep)); color: var(--cream); }
.pin-display { font-size: 1.6rem; letter-spacing: 8px; min-height: 2rem; }
.pin-placeholder { opacity: 0.35; }
.pin-keypad { display: grid; grid-template-columns: repeat(3, 56px); gap: 10px; }
.pin-key {
  width: 56px; height: 56px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08); color: var(--cream); font-size: 1.2rem; cursor: pointer;
}
.pin-key:active { background: rgba(255,255,255,0.2); }
.pin-feedback { min-height: 1.2rem; font-weight: 600; }
.pin-feedback.is-correct { color: var(--gold); }

/* ---------- Days counter ---------- */
.page--counter { background: var(--midnight); color: var(--cream); }
.counter-number { font-size: 4rem; font-weight: 700; color: var(--gold); line-height: 1; }
.counter-caption { font-size: 1.1rem; }

/* ---------- Gallery ---------- */
.page--gallery { justify-content: flex-start; padding-top: 40px; }
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: 100%; }
.gallery-item img, .gallery-item .photo-placeholder { width: 100%; aspect-ratio: 1/1; object-fit: cover; }

/* ---------- Message ---------- */
.page--message { background: var(--parchment); }
.message-text { line-height: 1.7; max-width: 34ch; }

/* ---------- Calendar reveal ---------- */
.page--calendar { background: linear-gradient(160deg, var(--midnight-deep), #23305c); color: var(--cream); }
.calendar-label { text-transform: uppercase; letter-spacing: 2px; font-size: 0.7rem; color: var(--gold); }
.calendar-card { background: rgba(255,255,255,0.08); border-radius: 12px; padding: 20px; width: 90%; }
.calendar-date { font-size: 1.2rem; font-weight: 600; }
.calendar-badge { margin-top: 8px; color: var(--gold); font-weight: 700; }

/* ---------- Closing ---------- */
.page--closing { background: linear-gradient(180deg, var(--parchment), var(--cream)); }
.bouquet-deco { font-size: 2.5rem; }
.handwritten--large { font-size: 1.6rem; max-width: 26ch; }
.signature { font-style: italic; color: var(--muted); }
.made-with { margin-top: auto; font-size: 0.7rem; color: var(--muted); text-decoration: none; }

/* ---------- Locked screen (time-lock) ---------- */
.locked-screen {
  max-width: 480px; margin: 10vh auto; padding: 40px 24px; text-align: center;
  background: var(--midnight); color: var(--cream); border-radius: 18px;
}
.locked-icon { font-size: 2.5rem; }
.locked-date { font-size: 1.3rem; color: var(--gold); font-weight: 700; margin: 8px 0; }

@media (max-width: 420px) {
  .flipbook { border-radius: 0; height: 100vh; max-width: 100%; }
}
