/* ============================================================
   global.css — Estilos Base y Variables Globales Compartidas
   ============================================================ */

/* ---- CSS Custom Properties (Design Tokens) ---- */
:root {
  /* Colors */
  --color-bg-deep: #FAF8F5;
  --color-bg-surface: #ffffff;
  --color-bg-card: rgba(255, 255, 255, 0.85);

  --color-crimson: #bd2735;
  --color-crimson-light: #e65564;
  --color-crimson-dark: #8c1621;

  --color-gold: var(--color-crimson);
  --color-gold-light: var(--color-crimson-light);
  --color-gold-dark: var(--color-crimson-dark);

  --color-cream: #f4efeb;
  --color-blush: #fcdbdc;
  --color-text-primary: #2b2725;
  --color-text-secondary: #5c5652;
  --color-text-muted: #a39c97;
  --color-success: #4e8c61;
  --color-error: #bd2735;
  --color-warning: #d99a26;

  /* Gradients */
  --gradient-gold: linear-gradient(135deg, var(--color-crimson-dark), var(--color-crimson), var(--color-crimson-light));
  --gradient-bg: linear-gradient(180deg, #FAF8F5 0%, #F5F1E9 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.8));

  /* Typography */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-names: 'Alex Brush', cursive;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 50%;

  /* Shadows */
  --shadow-glow: 0 0 30px rgba(188, 39, 53, 0.08);
  --shadow-card: 0 8px 32px rgba(92, 86, 82, 0.06);
  --shadow-btn: 0 4px 20px rgba(188, 39, 53, 0.25);
  --shadow-sm: 0 2px 8px rgba(92, 86, 82, 0.08);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--gradient-bg);
  color: var(--color-text-primary);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Particles Canvas (Background) ---- */
#particles-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

/* ---- Glass Effect ---- */
.glass {
  background: var(--gradient-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(188, 39, 53, 0.08);
  box-shadow: var(--shadow-card);
}

/* ---- App Container ---- */
.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  padding: var(--space-md) var(--space-sm);
  max-width: 412px;
  margin: 0 auto;
}

/* ---- Hero Section ---- */
.hero {
  text-align: center;
  padding: 0 0 var(--space-sm);
  animation: fadeInUp 1s var(--transition-base);
}

.invitation-card {
  position: relative;
  width: 140px;
  height: 125px;
  margin: 0 auto var(--space-md);
  display: flex;
  justify-content: center;
  align-items: center;
}

.invitation-card__heart {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(188, 39, 53, 0.15));
}

.hero__ornament {
  font-size: 1rem;
  color: var(--color-crimson);
  letter-spacing: 0.6em;
  opacity: 0.5;
  margin-top: var(--space-sm);
  animation: sparkle 3s ease-in-out infinite;
}

.hero__date {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: 0;
  border-bottom: 1px double var(--color-crimson-dark);
  display: inline-block;
  padding-bottom: var(--space-xs);
  opacity: 0.85;
}

.hero__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  line-height: 1.05;
  margin-top: var(--space-xs);
  width: 100%;
  padding: 0 var(--space-xs);
  box-sizing: border-box;
  text-align: center;
}

.hero__name {
  font-family: var(--font-names);
  font-weight: normal;
  font-size: clamp(2.8rem, 11.5vw, 4.5rem);
  color: var(--color-crimson-dark);
  text-align: center;
  width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  display: inline-block;
}

.hero__ampersand {
  font-family: var(--font-names);
  font-size: clamp(2.2rem, 8vw, 3.2rem);
  color: var(--color-crimson);
  opacity: 0.85;
  margin: var(--space-xs) 0;
}

.hero__subtitle {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--color-text-primary);
  margin-top: var(--space-sm);
  letter-spacing: 0.05em;
  font-style: italic;
}

/* ---- Footer ---- */
.footer {
  padding: var(--space-md) 0 var(--space-sm);
  text-align: center;
  animation: fadeInUp 1s 0.6s both;
  margin-top: auto; /* Empuja el footer al fondo de la pantalla */
}

.footer p {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}

/* ---- Toast Notifications ---- */
.toast-container {
  position: fixed;
  top: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 90%;
  max-width: 400px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: toastIn 0.4s ease, toastOut 0.4s ease 6s forwards;
  pointer-events: auto;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.toast--success {
  background: rgba(107, 203, 119, 0.15);
  border: 1px solid rgba(107, 203, 119, 0.3);
  color: var(--color-success);
}

.toast--error {
  background: rgba(255, 107, 107, 0.15);
  border: 1px solid rgba(255, 107, 107, 0.3);
  color: var(--color-error);
}

.toast__icon {
  font-size: 1rem;
  flex-shrink: 0;
}

/* ---- Keyframe Animations ---- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sparkle {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    transform: scale(0.95);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-16px);
  }
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #particles-canvas {
    display: none;
  }
}
