/* ============================================================
   InvitaYa — Design System
   Paleta: Terracota hsl(15.1 54.2% 51.2%) + Yeso #F8F5F0
   Font: Outfit (Google Fonts)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');

/* ── Variables ────────────────────────────────────────────── */
:root {
  --primary:       hsl(15.1, 54.2%, 51.2%);
  --primary-dark:  hsl(15.1, 54.2%, 36%);
  --primary-deep:  hsl(15.1, 54.2%, 26%);
  --primary-light: hsl(15.1, 54.2%, 92%);
  --primary-xlt:   hsl(15.1, 54.2%, 97%);

  --yeso:        #F8F5F0;
  --yeso-dark:   #EDE8E2;
  --white:       #FFFFFF;
  --text:        #2C2420;
  --text-muted:  #7A6E6A;
  --text-light:  #B5ADA9;
  --border:      #EDE8E2;
  --border-dark: #D4CCC5;

  --success:     hsl(145, 45%, 44%);
  --success-bg:  hsl(145, 45%, 95%);
  --danger:      hsl(0, 65%, 52%);
  --danger-bg:   hsl(0, 65%, 95%);
  --warning:     hsl(38, 90%, 50%);
  --warning-bg:  hsl(38, 90%, 95%);
  --info:        hsl(210, 65%, 50%);
  --info-bg:     hsl(210, 65%, 95%);

  --sidebar-w:   248px;
  --header-h:    64px;

  --radius-xs:  4px;
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  --shadow-xs:  0 1px 2px rgba(44,36,32,.06);
  --shadow-sm:  0 1px 4px rgba(44,36,32,.08);
  --shadow:     0 2px 10px rgba(44,36,32,.10);
  --shadow-lg:  0 8px 28px rgba(44,36,32,.14);

  --font:         'Outfit', sans-serif;
  --font-display: 'Playfair Display', serif;

  --transition: .18s ease;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--yeso);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button, input, select, textarea {
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
}

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5 { font-weight: 600; line-height: 1.3; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }
.display { font-family: var(--font-display); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

/* ── Layout Admin ─────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo img { height: 36px; width: auto; }
.sidebar-logo .logo-placeholder {
  height: 36px; width: 120px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  border: 2px dashed var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 600;
  color: var(--primary-dark);
  letter-spacing: .05em;
}
.sidebar-nav { padding: 12px 0; flex: 1; }
.nav-section {
  padding: 8px 20px 4px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-light);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 400;
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.nav-link:hover {
  background: var(--primary-xlt);
  color: var(--primary-dark);
  border-left-color: var(--primary-light);
}
.nav-link.active {
  background: var(--primary-xlt);
  color: var(--primary);
  font-weight: 600;
  border-left-color: var(--primary);
}
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar-sm {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 600;
  color: var(--primary-dark);
  flex-shrink: 0;
}

/* Main content area */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 1.05rem; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.page-body { padding: 28px; flex: 1; }

/* ── Layout Usuario ───────────────────────────────────────── */
.user-layout { min-height: 100vh; background: var(--yeso); }
.user-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.user-header-logo { height: 32px; width: auto; }
.user-body { max-width: 900px; margin: 0 auto; padding: 32px 20px; }

/* ── Layout Público ───────────────────────────────────────── */
.public-page {
  min-height: 100vh;
  background: var(--yeso);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 60px;
}
.public-logo { height: 40px; margin-bottom: 32px; }
.public-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow);
}
.public-event-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 4px;
  text-align: center;
}
.public-subtitle {
  font-size: .9rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-xs);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title { font-size: 1rem; font-weight: 600; }
.card + .card { margin-top: 20px; }

/* Stat card */
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; color: var(--primary); }
.stat-num { font-size: 1.75rem; font-weight: 600; line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }

/* Grid layouts */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--primary);
  color: var(--white);
}
.btn-primary:hover { background: var(--primary-dark); color: var(--white); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--yeso); color: var(--text); }
.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid transparent;
}
.btn-danger:hover { background: var(--danger); color: var(--white); }
.btn-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid transparent;
}
.btn-success:hover { background: var(--success); color: var(--white); }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-xs { padding: 4px 9px; font-size: .75rem; border-radius: var(--radius-sm); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}
.form-label .req { color: var(--primary); margin-left: 2px; }
.form-control {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  transition: var(--transition);
  background: var(--white);
  color: var(--text);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px hsla(15.1, 54.2%, 51.2%, .15);
}
.form-control::placeholder { color: var(--text-light); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-danger   { background: var(--danger-bg);  color: var(--danger); }
.alert-warning  { background: var(--warning-bg); color: var(--warning); }
.alert-info     { background: var(--info-bg);    color: var(--info); }

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th {
  background: var(--yeso);
  padding: 10px 14px;
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--primary-xlt); }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-muted   { background: var(--yeso-dark);    color: var(--text-muted); }

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs-nav {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}
.tab-btn {
  padding: 11px 18px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  white-space: nowrap;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Pase card (usuario) ──────────────────────────────────── */
.pase-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}
.pase-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-sm); }
.pase-num {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
  flex-shrink: 0;
}
.pase-info { flex: 1; min-width: 0; }
.pase-label { font-size: .8rem; font-weight: 500; color: var(--text-muted); }
.pase-link {
  font-size: .85rem;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pase-link.empty { color: var(--text-light); font-style: italic; }

/* ── Gallery / Fotos ──────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.photo-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--yeso);
}
.photo-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.photo-item:hover img { transform: scale(1.04); }
.photo-item .photo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(44,36,32,.45);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.photo-item:hover .photo-overlay { opacity: 1; }
.photo-action-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.photo-action-btn:hover { background: var(--white); transform: scale(1.1); }
.photo-action-btn svg { width: 15px; height: 15px; }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border-dark);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  background: var(--yeso);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-xlt);
}
.upload-zone svg { width: 36px; height: 36px; color: var(--text-light); margin: 0 auto 12px; }
.upload-zone p { font-size: .875rem; color: var(--text-muted); }
.upload-zone strong { color: var(--primary); }

/* ── Lightbox ─────────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,14,12,.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.lightbox-overlay.open { opacity: 1; pointer-events: all; }
.lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  transition: var(--transition);
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: none;
  cursor: pointer;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.lightbox-nav:hover { background: rgba(255,255,255,.3); }
.lightbox-prev { left: -56px; }
.lightbox-next { right: -56px; }
.lightbox-meta {
  margin-top: 12px;
  font-size: .8rem;
  color: rgba(255,255,255,.6);
  text-align: center;
}
.lightbox-dl {
  margin-top: 10px;
  padding: 7px 18px;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--white);
  font-size: .8rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Login page ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  background: var(--yeso);
}
.login-left {
  flex: 1;
  background: var(--primary);
  background-image: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px;
  color: var(--white);
}
.login-left .tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 2rem;
  opacity: .9;
  margin-top: 20px;
  text-align: center;
  line-height: 1.3;
}
.login-left .sub {
  font-size: .9rem;
  opacity: .7;
  margin-top: 10px;
  text-align: center;
}
.login-right {
  width: 460px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 52px;
  background: var(--white);
}
.login-logo-wrap {
  width: 140px; height: 44px;
  background: var(--primary-light);
  border-radius: var(--radius);
  border: 2px dashed var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: .1em;
  margin-bottom: 36px;
}
.login-title { font-size: 1.5rem; font-weight: 600; margin-bottom: 6px; }
.login-sub { font-size: .875rem; color: var(--text-muted); margin-bottom: 28px; }
.captcha-wrap {
  margin-bottom: 20px;
  padding: 14px;
  border: 1px dashed var(--border-dark);
  border-radius: var(--radius);
  background: var(--yeso);
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.captcha-placeholder {
  font-size: .78rem;
  color: var(--text-light);
  text-align: center;
}

/* ── Snackbar / Toast ─────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--text);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: .875rem;
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  animation: slideUp .25s ease;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Misc helpers ─────────────────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.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; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.p-0 { padding: 0; }
.text-center { text-align: center; }
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state svg {
  width: 48px; height: 48px;
  color: var(--border-dark);
  margin: 0 auto 12px;
}
.empty-state p { font-size: .9rem; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.copy-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: var(--success-bg);
  color: var(--success);
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity .3s;
}
.copy-badge.show { opacity: 1; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .login-left { display: none; }
  .login-right { width: 100%; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .lightbox-prev, .lightbox-next { display: none; }
}
@media (max-width: 560px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .page-body { padding: 16px; }
  .public-card { padding: 24px 18px; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
}
