/* ============================================================
   css/main.css — Design System Global (Minimalist & Premium)
   Paleta original: #E6D9FF #C4B5FD #A78BFA #7C3AED #2A1E4D
   Estilo: Minimalista, tipografía elegante, bordes finos, espacio generoso.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ─── Variables ─────────────────────────────────────────────── */
:root {
  /* Paleta de colores original */
  --c-lavender:   #E6D9FF;
  --c-violet-200: #C4B5FD;
  --c-violet-400: #A78BFA;
  --c-violet-600: #7C3AED;
  --c-violet-900: #2A1E4D;

  /* Estilo Minimalista (Fondo sólido, alto contraste, bordes muy sutiles) */
  --c-bg:         #0A0910;
  --c-surface:    #110F1C;
  --c-surface-2:  #161426;
  --c-border:     rgba(196, 181, 253, 0.08);
  --c-border-2:   rgba(196, 181, 253, 0.16);
  --c-text:       #F7F7FA;
  --c-muted:      #7C7795;
  --c-error:      #F87171;
  --c-success:    #4ADE80;
  --c-warning:    #FBBF24;

  /* Botones y elementos activos */
  --g-brand:      #7C3AED;
  --g-brand-hover:#6D28D9;
  
  /* Tipografía - Premium & Minimalist */
  --font:         'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --text-xs:      0.75rem;
  --text-sm:      0.875rem;
  --text-base:    1rem;
  --text-lg:      1.125rem;
  --text-xl:      1.25rem;
  --text-2xl:     1.5rem;
  --text-3xl:     1.875rem;
  --text-4xl:     2.5rem;
  --text-5xl:     3.5rem;

  /* Espaciado y Bordes */
  --radius-sm:    4px;
  --radius-md:    8px;
  --radius-lg:    12px;
  --radius-xl:    16px;
  --radius-full:  9999px;

  /* Sombras minimalistas sin brillos excesivos */
  --shadow-sm:    0 1px 2px rgba(0,0,0,0.5);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.6);
  --shadow-lg:    0 12px 24px rgba(0,0,0,0.8);

  --ease:         cubic-bezier(0.16, 1, 0.3, 1);
  --duration:     250ms;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background-color: var(--c-bg);
  color: var(--c-text);
  font-size: var(--text-base);
  line-height: 1.62;
  min-height: 100vh;
  letter-spacing: -0.01em;
}

a { 
  color: var(--c-text); 
  text-decoration: none; 
  transition: color var(--duration) var(--ease); 
}
a:hover { 
  color: var(--c-violet-400); 
}

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

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

/* ─── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--c-text);
}

.text-gradient {
  color: var(--c-text); /* Estilo minimalista prefiere texto limpio, pero dejamos soporte sutil */
}

/* ─── Layout ─────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

.container-sm {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Cards (Minimalistas con borde fino) ────────────────────── */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color var(--duration) var(--ease);
}

.card:hover {
  border-color: var(--c-border-2);
}

.card-glass {
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
  border-radius: var(--radius-lg);
  padding: 36px;
}

/* ─── Buttons (Minimalistas, sin gradientes, bordes limpios) ──── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--duration) var(--ease);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--c-text);
  color: var(--c-bg);
  border-color: var(--c-text);
}

.btn-primary:hover {
  background: var(--c-violet-200);
  border-color: var(--c-violet-200);
  color: var(--c-bg);
}

.btn-secondary {
  background: transparent;
  color: var(--c-text);
  border-color: var(--c-border-2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--c-text);
}

.btn-ghost {
  background: transparent;
  color: var(--c-muted);
  border: none;
}

.btn-ghost:hover {
  color: var(--c-text);
}

.btn-danger {
  background: transparent;
  color: var(--c-error);
  border-color: rgba(248,113,113,0.2);
}

.btn-danger:hover {
  background: rgba(248,113,113,0.08);
  border-color: var(--c-error);
}

.btn-sm { padding: 6px 12px; font-size: var(--text-xs); border-radius: var(--radius-sm); }
.btn-lg { padding: 14px 28px; font-size: var(--text-sm); border-radius: var(--radius-md); text-transform: uppercase; letter-spacing: 0.05em; }
.btn-full { width: 100%; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* Iconos SVG comunes */
.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: middle;
}
.icon-sm { width: 14px; height: 14px; stroke-width: 2; }
.icon-lg { width: 24px; height: 24px; stroke-width: 1.5; }

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

.form-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input,
.form-select,
.form-textarea {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--c-border-2);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--c-text);
  font-size: var(--text-sm);
  transition: all var(--duration) var(--ease);
  outline: none;
  width: 100%;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--c-text);
  background: rgba(255,255,255,0.04);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237C7795' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-select option {
  background: var(--c-surface-2);
  color: var(--c-text);
}

.form-textarea { resize: vertical; min-height: 90px; }

.form-hint {
  font-size: var(--text-xs);
  color: var(--c-muted);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--c-error);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ─── Badge ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success { background: rgba(74,222,128,0.1); color: var(--c-success); border: 1px solid rgba(74,222,128,0.15); }
.badge-error   { background: rgba(248,113,113,0.1); color: var(--c-error); border: 1px solid rgba(248,113,113,0.15); }
.badge-violet  { background: rgba(124,58,237,0.1); color: var(--c-violet-400); border: 1px solid rgba(124,58,237,0.15); }
.badge-warning { background: rgba(251,191,36,0.1); color: var(--c-warning); border: 1px solid rgba(251,191,36,0.15); }

/* ─── Progress bar ───────────────────────────────────────────── */
.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-bar-bg {
  height: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--c-text);
  border-radius: var(--radius-full);
  transition: width 0.4s var(--ease);
}

.progress-bar-fill.danger {
  background: var(--c-error);
}

/* ─── Toast / Alert ─────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  min-width: 250px;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastIn 0.25s var(--ease) forwards;
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
}

.toast.success { border-left: 3px solid var(--c-success); }
.toast.error   { border-left: 3px solid var(--c-error); }
.toast.info    { border-left: 3px solid var(--c-violet-400); }

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

/* ─── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration) var(--ease);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(10px);
  transition: transform var(--duration) var(--ease);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--c-muted);
  transition: color var(--duration) var(--ease);
  display: flex;
  align-items: center;
}

.modal-close:hover {
  color: var(--c-text);
}

/* ─── Loading / Spinner ─────────────────────────────────────── */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--c-text);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-lg {
  width: 32px;
  height: 32px;
}

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

.loading-state,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 16px;
  text-align: center;
  color: var(--c-muted);
}

.empty-state-icon {
  margin-bottom: 4px;
  color: var(--c-muted);
  opacity: 0.6;
}

.empty-state h3 { color: var(--c-text); font-size: var(--text-base); font-weight: 600; }
.empty-state p { font-size: var(--text-xs); max-width: 260px; }

/* ─── Divider ─────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--c-border);
  margin: 16px 0;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--c-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 16px 0;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--c-border);
}

/* ─── Utilities ───────────────────────────────────────────── */
.flex   { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2  { gap: 8px; }
.gap-4  { gap: 16px; }
.gap-6  { gap: 24px; }
.mt-2   { margin-top: 8px; }
.mt-4   { margin-top: 16px; }
.mt-6   { margin-top: 24px; }
.mb-4   { margin-bottom: 16px; }
.hidden { display: none !important; }
.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; }

/* ─── Toggle switch custom ────────────────────────────────── */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--c-border-2);
  border-radius: var(--radius-full);
  transition: all var(--duration) var(--ease);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 2px;
  top: 2px;
  background: var(--c-muted);
  border-radius: 50%;
  transition: all var(--duration) var(--ease);
}

.toggle input:checked + .toggle-slider {
  background: var(--c-text);
  border-color: var(--c-text);
}

.toggle input:checked + .toggle-slider::before {
  background: var(--c-bg);
  transform: translateX(16px);
}

/* ─── Image upload zone ───────────────────────────────────── */
.upload-zone {
  border: 1px dashed var(--c-border-2);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  background: rgba(255,255,255,0.01);
  position: relative;
}

.upload-zone:hover {
  border-color: var(--c-text);
  background: rgba(255,255,255,0.02);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-preview {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-top: 10px;
}

/* ─── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--c-bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .card { padding: 20px; }
  .card-glass { padding: 24px; }
  .modal { padding: 24px; }
}

/* ─── Logo images (nav, sidebar, footer) ─────────────────── */
.nav-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.sidebar-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.footer-main-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  opacity: 0.95;
}

.footer-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo-text {
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -0.03em;
}

.footer-right-wrap {
  display: flex;
  align-items: center;
}

/* ─── Footer branding (rom.code) ─────────────────────────── */
.footer-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--c-muted);
}

.footer-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--c-muted);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--duration) var(--ease);
}

.footer-brand-link:hover {
  color: var(--c-text);
}

.footer-brand-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
  opacity: 0.85;
  transition: opacity var(--duration) var(--ease);
}

.footer-brand-link:hover .footer-brand-logo {
  opacity: 1;
}


