/* ── MEMOIRE — BASE DESIGN SYSTEM ── */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

:root {
  /* Colors */
  --bg:          #0D0B0A;
  --surface:     #1A1714;
  --surface2:    #231F1B;
  --surface3:    #2C2722;
  --accent:      #C9A96E;
  --accent-dim:  #8A6B3E;
  --accent-soft: rgba(201,169,110,0.12);
  --text:        #F5EFE6;
  --text-mid:    #B8AFA5;
  --text-muted:  #6B6158;
  --border:      rgba(201,169,110,0.15);
  --border-soft: rgba(245,239,230,0.07);
  --danger:      #C96E6E;
  --success:     #6EC9A9;

  /* Spacing */
  --radius:    16px;
  --radius-sm: 10px;
  --radius-xs: 6px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 24px 64px rgba(0,0,0,0.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Noise overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.3;
}

/* Typography */
h1, h2, h3, h4, h5 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 100px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.25s;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover {
  background: #D4B47A;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(201,169,110,0.25);
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text-mid);
  border: 1px solid var(--border-soft);
}
.btn-secondary:hover {
  background: var(--surface3);
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-soft);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border);
}

.btn-danger {
  background: rgba(201,110,110,0.15);
  color: var(--danger);
  border: 1px solid rgba(201,110,110,0.2);
}
.btn-danger:hover {
  background: rgba(201,110,110,0.25);
}

.btn-full { width: 100%; }
.btn-sm { padding: 8px 18px; font-size: 13px; }
.btn-lg { padding: 16px 36px; font-size: 15px; }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* Loading spinner in button */
.btn.loading { pointer-events: none; }
.btn.loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ── INPUTS ── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

input, textarea, select {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 300;
  padding: 13px 16px;
  transition: border-color 0.25s, box-shadow 0.25s;
  outline: none;
  width: 100%;
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,169,110,0.1);
}

input.error, textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(201,110,110,0.1);
}

.input-error-msg {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' fill='none' stroke='%236B6158' stroke-width='1.5' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

select option {
  background: var(--surface2);
  color: var(--text);
}

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 24px;
}

.card-hover {
  transition: background 0.3s, border-color 0.3s, transform 0.2s;
  cursor: pointer;
}
.card-hover:hover {
  background: var(--surface2);
  border-color: var(--border);
  transform: translateY(-2px);
}

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

.badge-accent { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border); }
.badge-success { background: rgba(110,201,169,0.12); color: var(--success); border: 1px solid rgba(110,201,169,0.2); }
.badge-danger { background: rgba(201,110,110,0.12); color: var(--danger); border: 1px solid rgba(201,110,110,0.2); }
.badge-muted { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border-soft); }

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: var(--border-soft);
  margin: 24px 0;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 24px 0;
}
.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}

/* ── TOAST ── */
#toast-container {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 14px;
  color: var(--text-mid);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  animation: toastIn 0.3s ease;
}

.toast.success { border-color: rgba(110,201,169,0.3); }
.toast.success .toast-icon { color: var(--success); }
.toast.error { border-color: rgba(201,110,110,0.3); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--accent); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,11,10,0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px);
  transition: transform 0.3s;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  margin-bottom: 8px;
}

.modal-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
  line-height: 1.6;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.fade-up { animation: fadeUp 0.5s ease forwards; }
.fade-in { animation: fadeIn 0.4s ease forwards; }

/* ── LOGO ── */
.logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text);
  text-decoration: none;
}
.logo span { color: var(--accent); }

/* ── UTILS ── */
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-mid { color: var(--text-mid); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-center { text-align: center; }
.text-serif { font-family: 'Cormorant Garamond', serif; }

.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

/* ════════════════════════════════════════════
   ICONOS DE TIPOS DE EVENTO (sistema con mask)
   Para cambiar un icono: reemplaza el archivo en /iconos/ con el mismo nombre
   Frame Figma: 24x24px, stroke 1.3px, color negro, esquinas redondeadas, exportar SVG
   ════════════════════════════════════════════ */
.evt-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  background-color: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
.evt-icon-matrimonio  { -webkit-mask-image: url('../iconos/matrimonio.svg');  mask-image: url('../iconos/matrimonio.svg'); }
.evt-icon-cumpleanos  { -webkit-mask-image: url('../iconos/cumpleanos.svg');  mask-image: url('../iconos/cumpleanos.svg'); }
.evt-icon-bautizo     { -webkit-mask-image: url('../iconos/bautizo.svg');     mask-image: url('../iconos/bautizo.svg'); }
.evt-icon-grado       { -webkit-mask-image: url('../iconos/grado.svg');       mask-image: url('../iconos/grado.svg'); }
.evt-icon-corporativo { -webkit-mask-image: url('../iconos/corporativo.svg'); mask-image: url('../iconos/corporativo.svg'); }
.evt-icon-otro        { -webkit-mask-image: url('../iconos/otro.svg');        mask-image: url('../iconos/otro.svg'); }
