/* Base compartida por invitados, pantalla, álbum y tarjetas. */

:root {
  --font-script: 'Great Vibes', 'Brush Script MT', cursive;
  --font-hand: 'Caveat Variable', 'Caveat', 'Segoe Print', cursive;
  --font-sans: 'Montserrat Variable', 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --accent: #d4af37;
  --on-accent: #1b1b1b;
  --paper: #fbfaf6;
  --paper-ink: #2b2622;
  --radius: 18px;
}

/* ---------- Temas (se eligen por evento) ---------- */

:root,
[data-theme='noche'] {
  --bg-a: #0d0b1f;
  --bg-b: #2a1f4d;
  --bg-c: #4b2a5e;
  --ink: #f6f1e7;
  --ink-soft: rgba(246, 241, 231, 0.72);
  --surface: rgba(255, 255, 255, 0.07);
  --surface-strong: rgba(255, 255, 255, 0.13);
  --line: rgba(255, 255, 255, 0.16);
  --shadow: rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

[data-theme='rosa'] {
  --bg-a: #fff5f7;
  --bg-b: #fbd9e3;
  --bg-c: #efb8cb;
  --ink: #4b2335;
  --ink-soft: rgba(75, 35, 53, 0.72);
  --surface: rgba(255, 255, 255, 0.55);
  --surface-strong: rgba(255, 255, 255, 0.85);
  --line: rgba(75, 35, 53, 0.14);
  --shadow: rgba(110, 40, 70, 0.28);
  color-scheme: light;
}

[data-theme='blanco'] {
  --bg-a: #fdfbf6;
  --bg-b: #f2ebdd;
  --bg-c: #e3d7bf;
  --ink: #3a3226;
  --ink-soft: rgba(58, 50, 38, 0.7);
  --surface: rgba(255, 255, 255, 0.6);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(58, 50, 38, 0.14);
  --shadow: rgba(70, 55, 30, 0.25);
  color-scheme: light;
}

[data-theme='esmeralda'] {
  --bg-a: #03201a;
  --bg-b: #0b3a2f;
  --bg-c: #14594a;
  --ink: #f4efe2;
  --ink-soft: rgba(244, 239, 226, 0.74);
  --surface: rgba(255, 255, 255, 0.07);
  --surface-strong: rgba(255, 255, 255, 0.13);
  --line: rgba(255, 255, 255, 0.16);
  --shadow: rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

/* ---------- Reset ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg-a);
  -webkit-font-smoothing: antialiased;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.script {
  font-family: var(--font-script);
  font-weight: 400;
  letter-spacing: 0.01em;
}

.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Fondo con brillo suave que usan invitados y álbum */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 70% at 10% 0%, var(--bg-b), transparent 60%),
    radial-gradient(100% 70% at 100% 100%, var(--bg-c), transparent 55%),
    var(--bg-a);
}

.backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(40% 30% at 80% 15%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 52px;
  padding: 0 1.4em;
  border: 0;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.2s ease, background 0.2s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 10px 28px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 50;
  max-width: min(92vw, 420px);
  padding: 14px 18px;
  border-radius: 14px;
  background: #1d1a24;
  color: #fff;
  font-size: 0.92rem;
  line-height: 1.35;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.toast.error {
  background: #8f1d2c;
}

.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
