/* millbury.app signing page (PL #49). iwilly-professional tokens (design.md):
   parchment page, white cards, crimson accent. Mobile first. */
:root {
  --bg: #f5f0e8;
  --bg-2: #e8e0d4;
  --card: #ffffff;
  --text: #2a2a2a;
  --muted: #5a5a5a;
  --accent: #630000;
  --accent-hover: #8a1a1a;
  --accent-rgb: 99, 0, 0;
  --border: rgba(var(--accent-rgb), 0.16);
  --danger: #9b2c2c;
  --ok: #2f6b3f;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(var(--accent-rgb), .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 var(--font);
}
img { max-width: 100%; display: block; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid rgba(var(--accent-rgb), .45); outline-offset: 2px; border-radius: 6px; }
#app:focus { outline: none; }

/* ---------- header / footer ---------- */
.site-header {
  background: var(--accent);
  color: #fff;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; max-width: 1200px; margin: 0 auto; }
.brand img { width: 21px; height: 42px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-district { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.brand-title { font-size: 17px; font-weight: 600; }
.site-footer { margin-top: auto; padding: 24px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.site-footer p { margin: 0; }
.noscript { padding: 16px; text-align: center; }

main { width: 100%; max-width: 1232px; margin: 0 auto; padding: 24px 16px 8px; }

/* ---------- type ---------- */
h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(28px, 6vw, 40px); line-height: 1.15; margin: 0 0 12px; letter-spacing: -.01em; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 22px; line-height: 1.25; margin: 0 0 6px; }
.eyebrow { margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.lede { font-size: 18px; color: var(--muted); margin: 0 0 16px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px;
  border-radius: 999px; border: 2px solid transparent;
  font: 600 17px/1 var(--font); text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--border); }
.btn-ghost:hover { background: rgba(var(--accent-rgb), .06); }
.btn-block { width: 100%; }

/* ---------- home ---------- */
.home-intro { margin: 8px 0 28px; }
.doc-grid { display: grid; gap: 20px; }
@media (min-width: 720px) { .doc-grid { grid-template-columns: 1fr 1fr; } }
.doc-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.doc-art { width: 100%; height: auto; aspect-ratio: 700 / 560; object-fit: cover; background: var(--bg-2); }
.doc-body { padding: 20px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.doc-body .btn { margin-top: auto; align-self: flex-start; }
.doc-meta { margin: 0 0 16px; color: var(--muted); font-size: 15px; }
.doc-sent { margin: -8px 0 16px; color: var(--ok); font-weight: 600; font-size: 15px; }
/* Laptop and wider: the same art-beside-text card as the deck, so both
   Start buttons sit on the first screen. */
@media (min-width: 900px) {
  .doc-card { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: center; }
  .doc-body { padding: 24px 28px 24px 8px; }
}

/* ---------- deck ---------- */
.deck { max-width: 680px; margin: 0 auto; }
.deck-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 15px; }
.deck-exit { text-decoration: none; font-weight: 600; padding: 8px 0; }
.deck-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.progress { height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; margin-bottom: 20px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .35s ease; }

.slide {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  animation: slide-in .35s ease both;
}
@keyframes slide-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.slide-art { width: 100%; height: auto; max-height: 34vh; aspect-ratio: 700 / 560; object-fit: contain; background: #fff; }
.slide-text { padding: 24px 20px 28px; }
.slide-text.is-ghost { display: none; }
@media (min-width: 600px) { .slide-text { padding: 32px 36px 36px; } }
/* Laptop and wider: art beside the text, not above it, so a card reads
   without scrolling. The signature slide has no art and stays narrow. */
@media (min-width: 900px) {
  .deck { max-width: 1200px; }
  .slide:not(.slide-sign) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }
  .slide:not(.slide-sign) .slide-art { max-height: none; }
  .slide:not(.slide-sign) .slide-text { padding: 28px 44px 28px 8px; }
  .slide-texts { display: grid; }
  .slide-texts > .slide-text { grid-area: 1 / 1; }
  .slide-text.is-ghost { display: block; visibility: hidden; }
  .slide-sign { max-width: 680px; margin: 0 auto; }
}
.slide-title { font-size: clamp(26px, 5.5vw, 34px); }
.slide-body { overflow-wrap: anywhere; }
.slide-body p { margin: 0 0 12px; font-size: 18px; }
.slide-list { margin: 0 0 16px; padding-left: 22px; font-size: 18px; }
.slide-list li { margin-bottom: 8px; }
.talk {
  margin: 20px 0 0; padding: 12px 16px; border-left: 4px solid var(--accent);
  background: rgba(var(--accent-rgb), .05); border-radius: 0 10px 10px 0;
  color: var(--muted); font-style: italic; font-size: 16px;
}
.deck-nav {
  position: sticky; bottom: 0; z-index: 2;
  display: grid; grid-template-columns: 1fr 2fr; gap: 12px;
  padding: 16px 0 max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, rgba(245, 240, 232, 0));
}

/* ---------- sign form ---------- */
.sign-form { margin-top: 8px; }
fieldset { border: 0; padding: 0; margin: 0 0 20px; }
legend { font-weight: 700; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; padding: 0; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 16px; }
input[type="text"], input[type="email"] {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1.5px solid #cfc6b8; border-radius: 12px; background: #fff;
  font: 17px var(--font); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:focus, input[type="email"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .12); }
.signin, .signed-in {
  padding: 14px 16px; border: 1.5px solid #cfc6b8; border-radius: 12px; background: var(--bg);
}
.signin-ask { margin: 0 0 10px; font-weight: 600; font-size: 16px; }
.gsi-slot { min-height: 44px; }
.signin .form-status { margin: 10px 0 0; }
.signed-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; border-color: var(--ok); }
.signed-in p { margin: 0; overflow-wrap: anywhere; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--accent); font: 600 15px var(--font); text-decoration: underline; cursor: pointer; }
.hint { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.agree {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px; margin: 4px 0 16px;
  background: rgba(var(--accent-rgb), .04); border: 1px solid var(--border); border-radius: 12px;
  cursor: pointer; font-size: 16px;
}
.agree input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.form-status { min-height: 0; margin: 0 0 12px; color: var(--danger); font-weight: 600; }
.form-status:empty { display: none; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.back-link { margin: 20px 0 0; font-size: 15px; text-align: center; }

/* ---------- done ---------- */
.done { max-width: 560px; margin: 24px auto; text-align: center; animation: slide-in .35s ease both; }
.done-mark {
  width: 84px; height: 84px; margin: 0 auto 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 44px; font-weight: 700;
  animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.done-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
