/* ==========================================================================
   Design tokens — a wedding-stationery palette, not the generic
   cream+terracotta combo: deep plum ink, a dusty-rose accent, a muted
   gold flourish colour (used sparingly, for the rule/divider device),
   and a soft sage for secondary states. Matches the generated wish-card
   graphic's colours (includes/wishcard.php) so the two feel like one
   set of stationery.
   ========================================================================== */
:root {
  --paper: #faf4ec;
  --paper-deep: #f3e9dc;
  --ink: #3a2433;
  --ink-soft: #6b5563;
  --accent: #b4667a;
  --accent-deep: #8f4b5c;
  --gold: #a9834f;
  --sage: #7c8b6f;
  --line: #e4d5c8;
  --error: #a6403b;
  --success: #5c7a4f;
  --shadow: rgba(58, 36, 51, 0.10);
  font-size: 17px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Crimson Text', Georgia, 'Times New Roman', serif;
  background: var(--paper);
  background-image: radial-gradient(ellipse 900px 500px at 50% -10%, var(--paper-deep), transparent);
  background-repeat: no-repeat;
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Actual data-entry controls stay in a plain, neutral face — typing into
   a script/display serif at small phone sizes hurts legibility, and this
   is the one place function should win over the stationery styling. */
input, textarea, button {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 28px 18px 96px;
}

.center-page {
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding-top: 24px;
  padding-bottom: 24px;
}

.hidden { display: none !important; }

/* ---- Header: hero photo (optional), couple's names in script, tagline ---- */
.site-header {
  text-align: center;
  margin-bottom: 22px;
}
.hero-photo-wrap {
  margin: -4px -2px 18px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 28px var(--shadow);
  aspect-ratio: 4 / 3;
}
.hero-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.site-header h1 {
  font-family: 'Great Vibes', cursive;
  font-weight: 400;
  font-size: 3.1rem;
  line-height: 1.1;
  margin: 0;
  color: var(--ink);
}
.site-header p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-style: italic;
  font-size: 1.02rem;
}

/* Signature divider device — used consistently wherever the page wants to
   mark a beat (under the header, above the footer, on the card). */
.rule-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 16px 0 22px;
}
.rule-divider::before,
.rule-divider::after {
  content: '';
  height: 1px;
  width: 44px;
  background: var(--gold);
}
.rule-divider .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.card {
  background: #fffdfa;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 20px;
  margin-bottom: 16px;
  box-shadow: 0 6px 20px var(--shadow);
}

.card h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 14px;
}

.disclaimer-text {
  font-size: 0.96rem;
  line-height: 1.55;
  color: #4a3a44;
  margin-bottom: 14px;
}
.disclaimer-text .terms-link {
  color: var(--accent-deep);
  font-style: italic;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.95rem;
}
.checkbox-row input { margin-top: 3px; width: 20px; height: 20px; accent-color: var(--accent); }
.checkbox-row label { line-height: 1.4; }

.btn-primary, .btn-secondary {
  display: inline-block;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  transition: background-color 0.15s ease, transform 0.05s ease;
}
.btn-primary {
  background: var(--accent);
  color: #fff5f0;
}
.btn-primary:disabled {
  background: #ddc9ce;
  color: #fff;
  cursor: not-allowed;
}
.btn-primary:not(:disabled):active { background: var(--accent-deep); transform: translateY(1px); }

.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-secondary:active { background: var(--paper-deep); }

.btn-link {
  background: none;
  border: none;
  color: var(--accent-deep);
  font-size: 0.95rem;
  padding: 0 0 12px;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- Menu: three options, each with a small colour-coded badge rather
   than a bare emoji — a considered, restrained bit of colour variety
   instead of three identical boxes. ---- */
.menu-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.menu-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: #fffdfa;
  border: 1px solid var(--line);
  border-radius: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.02rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--shadow);
}
.menu-btn:active { background: var(--paper-deep); }
.menu-icon {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.menu-btn:nth-child(1) .menu-icon { background: #f3dfe4; }
.menu-btn:nth-child(2) .menu-icon { background: #e9e6d8; }
.menu-btn:nth-child(3) .menu-icon { background: #e4e8dd; }

.field { margin-bottom: 16px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
.field label {
  display: block;
  font-size: 0.9rem;
  color: #6b6058;
  margin-bottom: 6px;
}
.field input[type="text"], .field textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
}
.field input[type="text"]:focus, .field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.field textarea { resize: vertical; }

.char-count {
  text-align: right;
  font-size: 0.85rem;
  color: #8a8078;
  margin-top: 4px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.hint-text {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin-top: -8px;
}

.landscape-hint {
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: #6b4a2c;
  margin-bottom: 16px;
}

.dropzone {
  border: 2px dashed var(--line);
  border-radius: 14px;
  padding: 28px 16px;
  text-align: center;
  margin-bottom: 8px;
}
.dropzone p { margin: 0 0 12px; color: var(--ink-soft); }
.pick-label {
  display: inline-block;
  background: var(--accent);
  color: #fff5f0;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.dropzone input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0; overflow: hidden;
}

.camera-frame {
  position: relative;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
  aspect-ratio: 16 / 9;
}
.camera-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pre-record-countdown {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-weight: 800;
  font-size: 6rem;
  line-height: 1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
  animation: pre-record-pop 1s ease-in-out infinite;
}
@keyframes pre-record-pop {
  0% { transform: scale(0.8); opacity: 0.6; }
  30% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 0.9; }
}
.record-countdown {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(166, 64, 58, 0.9);
  color: #fff;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.95rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.controls-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

#queue { margin-top: 12px; }
.queue-item {
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.queue-item:first-child { border-top: none; }
.queue-item .name {
  font-size: 0.9rem;
  margin-bottom: 6px;
  word-break: break-all;
}
.bar-track {
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}
.queue-item .status {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 4px;
}
.queue-item.done .status { color: var(--success); }
.queue-item.error .status { color: var(--error); }
.queue-item.error .bar-fill { background: var(--error); }

.error-text {
  color: var(--error);
  font-size: 0.9rem;
  margin-top: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.keep-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--accent-deep);
  color: #fff5f0;
  text-align: center;
  padding: 14px 16px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  z-index: 10;
}

.site-footer {
  text-align: center;
  color: #a2968c;
  font-style: italic;
  font-size: 0.85rem;
  margin-top: 18px;
}

/* ---- Terms page ---- */
.terms-body h1 { font-family: 'Great Vibes', cursive; font-size: 2.6rem; font-weight: 400; text-align: center; margin: 0 0 4px; }
.terms-body .terms-subtitle { text-align: center; color: var(--ink-soft); font-style: italic; margin: 0 0 4px; }
.terms-body .card { line-height: 1.6; }
.terms-body .card p { margin: 0 0 14px; }
.terms-body .card p:last-child { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  .pre-record-countdown { animation: none; }
  .btn-primary, .btn-secondary { transition: none; }
}
