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

:root {
  --bg: #0f0f14;
  --bg2: #16161e;
  --bg3: #1e1e2a;
  --border: #2a2a3a;
  --accent: #7c6ef0;
  --accent2: #5a50d0;
  --text: #e8e8f0;
  --text-dim: #888899;
  --success: #4ecb8d;
  --danger: #e05555;
  --warning: #e0a040;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* Navbar */
.navbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  height: 54px;
  gap: 1.5rem;
}
.navbar-brand { font-size: 1rem; font-weight: 600; color: var(--text); }
.navbar-brand span { color: var(--accent); }
.navbar-spacer { flex: 1; }
.navbar-user { font-size: 0.8rem; color: var(--text-dim); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: opacity 0.15s, background 0.15s;
  white-space: nowrap;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.76rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 1.2rem; }
label { display: block; font-size: 0.78rem; color: var(--text-dim); margin-bottom: 0.35rem; letter-spacing: 0.02em; text-transform: uppercase; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time], input[type=url], select, textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem 0.85rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input::placeholder { color: rgba(232,232,240,0.3); }
select option { background: var(--bg3); }
textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.check-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.9rem; }
.check-label input { width: auto; }

/* Cards */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
}

/* Page shell */
.page { padding: 2rem 0; }
.page-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.page-title { font-size: 1.3rem; font-weight: 600; }

/* Login */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { width: 100%; max-width: 360px; }
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo h1 { font-size: 1.5rem; font-weight: 700; }
.login-logo h1 span { color: var(--accent); }
.login-logo p { color: var(--text-dim); font-size: 0.85rem; margin-top: 0.3rem; }
#login-error { color: var(--danger); font-size: 0.85rem; margin-top: 0.5rem; min-height: 1.2rem; }

/* Invitations list */
.inv-grid { display: flex; flex-direction: column; gap: 0.75rem; }

/* Mobile-first: tarjeta vertical */
.inv-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.inv-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.inv-tipo-badge {
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}
.inv-tipo-casamiento { background: rgba(196,96,122,0.2); color: #e08095; }
.inv-tipo-cumpleanos { background: rgba(212,168,83,0.2); color: #e0b860; }
.inv-rsvp { font-size: 0.78rem; color: var(--success); white-space: nowrap; margin-left: auto; }
.inv-nombre { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-meta { font-size: 0.78rem; color: var(--text-dim); }
.inv-meta-line { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.25rem; }

/* Desktop: layout horizontal */
@media (min-width: 750px) {
  .inv-card {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }
  .inv-card-header { flex-direction: column; align-items: flex-start; gap: 0.3rem; min-width: 0; }
  .inv-rsvp { margin-left: 0; }
  .inv-nombre { max-width: 260px; }
  .inv-meta { flex: 1; min-width: 0; }
  .inv-actions { margin-top: 0; flex-wrap: nowrap; }
}

.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text-dim); }
.empty-state p { font-size: 1.05rem; margin-bottom: 1.5rem; }

/* Toast */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  background: var(--bg3); border: 1px solid var(--border);
  padding: 0.8rem 1.2rem; border-radius: 6px;
  font-size: 0.88rem; max-width: 320px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: slideIn 0.2s ease;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  padding: 1.5rem; width: 100%; max-width: 420px;
}
.modal h3 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1.5rem; }
