/* =====================================================
   XER Cleaner — CSS Global Centralizado
   xer-common.css
   Generado: 2026-05-16
   ===================================================== */


/* =====================================================
   SECCIÓN 1 — Variables CSS
   ===================================================== */
:root {
  /* Colores principales */
  --color-cyan:         #06b6d4;
  --color-cyan-dark:    #0891b2;
  --color-cyan-light:   #22d3ee;
  --color-violet:       #8b5cf6;
  --color-violet-dark:  #7c3aed;
  --color-violet-light: #c4b5fd;
  --color-green:        #10b981;
  --color-amber:        #f59e0b;
  --color-red:          #ef4444;

  /* Fondos y superficies */
  --color-dark:         #1e293b;
  --color-darker:       #0f172a;
  --color-border:       #334155;

  /* Texto */
  --color-text:         #f8fafc;
  --color-text-soft:    #f1f5f9;
  --color-text-muted:   #94a3b8;
  --color-text-dim:     #64748b;
  --color-text-dimmer:  #475569;

  /* Espaciado */
  --spacing-xs:  0.25rem;
  --spacing-sm:  0.5rem;
  --spacing-md:  1rem;
  --spacing-lg:  1.5rem;
  --spacing-xl:  2rem;

  /* Border radius */
  --border-radius-sm:  6px;
  --border-radius-md:  8px;
  --border-radius-lg:  12px;
}


/* =====================================================
   SECCIÓN 2 — Reset + body base
   ===================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  min-height: 100vh;
  color: #f8fafc;
}

html.light body {
  background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
  color: #0f172a;
}


/* =====================================================
   SECCIÓN 3 — Navegación
   ===================================================== */
.nav {
  height: 64px;
  padding: 0 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 999;
  background: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Switch tema claro/oscuro */
.switch-toggle {
  width: 36px;
  height: 18px;
  background: rgba(6, 182, 212, 0.3);
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  border: 0.5px solid rgba(6, 182, 212, 0.5);
}

.switch-circle {
  width: 14px;
  height: 14px;
  background: #06b6d4;
  border-radius: 50%;
  position: absolute;
  right: 2px;
  top: 2px;
  transition: all 0.3s;
}

/* Botón volver */
.btn-back {
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #f8fafc;
}

/* Light mode — Nav */
html.light .nav {
  background: #ffffff;
  border-bottom-color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

html.light .switch-toggle { background: rgba(6, 182, 212, 0.2); border-color: rgba(6, 182, 212, 0.3); }
html.light .switch-circle { right: auto; left: 2px; }
html.light .nav-link      { color: #64748b; }
html.light .nav-link:hover { color: #0f172a; }

html.light .btn-back {
  background: rgba(15, 23, 42, 0.08);
  color: #64748b;
  border-color: #cbd5e1;
}

html.light .btn-back:hover {
  background: #e2e8f0;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  transform: translateY(-1px);
}


/* =====================================================
   SECCIÓN 4 — Botón X para cerrar modales (.modal-close)
   Tamaño aumentado a 40×40px para mejor clickabilidad
   ===================================================== */
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  font-size: 20px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0;
  transition: background 0.15s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

html.light .modal-close {
  color: #64748b;
  background: rgba(15, 23, 42, 0.05);
}

html.light .modal-close:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.1);
}


/* =====================================================
   SECCIÓN 5 — Credits Badge
   ===================================================== */
.credits-badge {
  background: rgba(6, 182, 212, 0.15);
  border: 0.5px solid rgba(6, 182, 212, 0.3);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #22d3ee;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.credits-badge strong { color: #06b6d4; }
.credits-badge:hover  { background: rgba(6, 182, 212, 0.25); }

html.light .credits-badge {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.25);
  color: #0891b2;
}

html.light .credits-badge strong { color: #0891b2; }


/* =====================================================
   SECCIÓN 6 — Modal Contacto
   (historial, resultados, procesar_redundancia, procesar_redaccion)
   ===================================================== */
.contact-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.contact-modal-overlay.open { display: flex; }

.contact-modal-card {
  background: #1e293b;
  border: 0.5px solid #334155;
  border-radius: 16px;
  padding: 36px;
  max-width: 500px;
  width: 100%;
  position: relative;
}

.contact-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.08);
  border: 0.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #94a3b8;
}

.contact-modal-close:hover { background: rgba(255, 255, 255, 0.15); color: #f8fafc; }

.contact-modal-title    { font-size: 20px; font-weight: 700; color: #f8fafc; margin-bottom: 6px; }
.contact-modal-subtitle { font-size: 14px; color: #94a3b8; margin-bottom: 24px; }

.contact-form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #f1f5f9;
  margin-bottom: 6px;
}

.contact-form-input,
.contact-form-textarea {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 0.5px solid #334155;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  color: #f8fafc;
  font-family: inherit;
  margin-bottom: 16px;
}

.contact-form-input:focus,
.contact-form-textarea:focus    { outline: none; border-color: #06b6d4; }
.contact-form-input[readonly]   { opacity: 0.65; cursor: default; }
.contact-form-textarea          { resize: vertical; min-height: 110px; line-height: 1.6; }

.contact-form-btn {
  width: 100%;
  background: #06b6d4;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.contact-form-btn:hover    { background: #0891b2; }
.contact-form-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.contact-form-error {
  display: none;
  background: rgba(239, 68, 68, 0.1);
  border: 0.5px solid #ef4444;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #f87171;
  margin-bottom: 14px;
}

.contact-form-success { display: none; text-align: center; padding: 16px 0; }

html.light .contact-modal-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

html.light .contact-modal-title    { color: #0f172a; }
html.light .contact-modal-subtitle { color: #64748b; }

html.light .contact-modal-close {
  background: rgba(15, 23, 42, 0.06);
  border-color: #cbd5e1;
  color: #64748b;
}

html.light .contact-modal-close:hover { background: rgba(15, 23, 42, 0.12); color: #0f172a; }
html.light .contact-form-label        { color: #0f172a; }

html.light .contact-form-input,
html.light .contact-form-textarea {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}


/* =====================================================
   SECCIÓN 7 — Modal Cerrar Sesión
   (historial, resultados, procesar_redundancia, procesar_redaccion)
   ===================================================== */
.modal-logout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-logout-overlay.visible { opacity: 1; pointer-events: auto; }

.modal-logout-box {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 32px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-logout-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.modal-logout-title   { font-size: 20px; font-weight: 600; color: #f8fafc; text-align: center; margin: 0; }
.modal-logout-body    { text-align: center; margin-bottom: 28px; }
.modal-logout-message { font-size: 14px; color: #cbd5e1; margin: 0; }
.modal-logout-actions { display: flex; gap: 12px; }

.btn-logout-cancel {
  flex: 1;
  background: #475569;
  color: #f8fafc;
  border: none;
  padding: 11px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-logout-cancel:hover { background: #334155; }

.btn-logout-confirm {
  flex: 1;
  background: #ef4444;
  color: white;
  border: none;
  padding: 11px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-logout-confirm:hover { background: #dc2626; transform: translateY(-1px); }

html.light .modal-logout-box          { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15); }
html.light .modal-logout-title        { color: #0f172a; }
html.light .modal-logout-message      { color: #64748b; }
html.light .btn-logout-cancel         { background: #e2e8f0; color: #0f172a; }
html.light .btn-logout-cancel:hover   { background: #cbd5e1; }
html.light .btn-logout-confirm        { background: #dc2626; }
html.light .btn-logout-confirm:hover  { background: #b91c1c; }

@media (max-width: 768px) {
  .modal-logout-box     { padding: 24px; }
  .modal-logout-actions { flex-direction: column-reverse; }
}


/* =====================================================
   SECCIÓN 8 — Modo claro: bloque universal de contenedores
   ===================================================== */
html.light .modal-content,
html.light .card,
html.light .plan-card,
html.light .service-card,
html.light .hero-card,
html.light .upload-section,
html.light .results-section,
html.light .upload-card,
html.light .options-card,
html.light .stats-card,
html.light .register-prompt {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #0f172a;
}

html.light .modal-overlay {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

html.light h1,
html.light h2,
html.light h3,
html.light h4 {
  color: #1e293b;
}

html.light p,
html.light label {
  color: #64748b;
}

html.light input,
html.light textarea,
html.light select {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}

html.light .status-messages { background: #f1f5f9; }


/* =====================================================
   SECCIÓN 9 — Barra de progreso
   (procesar_redundancia, procesar_redaccion)
   Nota: procesar_redaccion sobreescribe progress-fill con #a855f7
   ===================================================== */
.progress-container {
  display: none;
  margin-top: 16px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  color: #94a3b8;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: #06b6d4;
  border-radius: 99px;
  transition: width 0.25s ease;
}

html.light .progress-header { color: #64748b; }
html.light .progress-track  { background: #e2e8f0; }
