/* Tienda de la Confianza — sistema de diseño futurista
   Compartido por el panel admin y las páginas de clientes. */

:root {
  /* --- Superficies --- */
  --fondo-profundo: #05070f;
  --crema: #070b16;            /* fondo base (nombre heredado) */
  --papel: rgba(255, 255, 255, .045);
  --papel-alto: rgba(255, 255, 255, .075);
  --borde: rgba(140, 190, 255, .14);
  --borde-fuerte: rgba(140, 190, 255, .26);

  /* --- Acentos neón --- */
  --verde: #00e5a0;
  --verde-oscuro: #00b483;
  --verde-claro: rgba(0, 229, 160, .13);
  --cian: #35d6f5;
  --violeta: #8b7dff;
  --ambar: #ffc65c;
  --ambar-claro: rgba(255, 198, 92, .13);
  --rojo: #ff6b8a;
  --rojo-claro: rgba(255, 107, 138, .13);

  /* --- Texto --- */
  --texto: #e9f0fb;
  --texto-suave: #8fa3c0;
  /* Para escribir sobre superficies CLARAS (tarjetas blancas, barra de pestañas):
     los de arriba son claros, pensados para fondo oscuro, e ilegibles sobre blanco. */
  --texto-oscuro: #1a2333;
  --texto-oscuro-suave: #3a4a63;
  --verde-legible: #007a56;   /* variante de --verde con contraste suficiente sobre blanco */

  /* Alias de compatibilidad: nombres usados por login.html, registro.html,
     comprar.html y catalogo.html que no tenían variable definida (el color
     no aplicaba y dejaba botones sin fondo, transparentes). */
  --fondo: var(--crema);
  --verde-confianza: var(--verde-oscuro);
  --acento-ambar: var(--ambar);

  /* --- Tipografía --- */
  --fuente-marca: 'Segoe UI Variable Display', 'Inter', 'Segoe UI', system-ui, sans-serif;
  --fuente-texto: 'Segoe UI Variable Text', 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --fuente-mono: 'Cascadia Code', 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  --radio: 14px;
  --sombra: 0 8px 32px rgba(0, 0, 0, .45);
  --brillo: 0 0 24px rgba(0, 229, 160, .28);
  --transicion: 180ms cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }

body {
  font-family: var(--fuente-texto);
  background: var(--crema);
  color: var(--texto);
  margin: 0;
  min-height: 100vh;
  /* Halos de color + rejilla técnica de fondo */
  background-image:
    radial-gradient(900px 500px at 12% -8%, rgba(0, 229, 160, .10), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(53, 214, 245, .09), transparent 55%),
    radial-gradient(700px 600px at 50% 110%, rgba(139, 125, 255, .08), transparent 60%),
    linear-gradient(rgba(140, 190, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 190, 255, .035) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 46px 46px, 46px 46px;
  background-attachment: fixed;
}

::selection { background: rgba(0, 229, 160, .3); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: rgba(255, 255, 255, .03); }
::-webkit-scrollbar-thumb {
  background: rgba(140, 190, 255, .2);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 229, 160, .45); background-clip: content-box; }

/* ---------- Marca / logotipo ---------- */
.marca { display: flex; align-items: center; gap: 12px; }

.marca .icono-marca {
  width: 36px; height: 36px; flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(0, 229, 160, .55));
}

.marca .texto-marca {
  font-family: var(--fuente-marca);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -.2px;
  line-height: 1.1;
  background: linear-gradient(96deg, #fff 10%, var(--verde) 55%, var(--cian) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.marca .texto-marca small {
  display: block;
  font-family: var(--fuente-texto);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--texto-suave);
  -webkit-text-fill-color: var(--texto-suave);
  margin-top: 3px;
}

/* ---------- Tarjetas (vidrio) ---------- */
.tarjeta {
  position: relative;
  background: var(--papel);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 22px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
}

/* Filo luminoso superior */
.tarjeta::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 160, .5), rgba(53, 214, 245, .35), transparent);
}

/* ---------- Botones ---------- */
button.btn, a.btn {
  position: relative;
  background: linear-gradient(135deg, var(--verde), var(--verde-oscuro));
  color: #04241a;
  border: 0;
  border-radius: 10px;
  padding: 11px 20px;
  font-family: var(--fuente-texto);
  font-size: .93rem;
  font-weight: 700;
  letter-spacing: .2px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 4px 18px rgba(0, 229, 160, .28);
  transition: transform var(--transicion), box-shadow var(--transicion), filter var(--transicion);
}
button.btn:hover, a.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 26px rgba(0, 229, 160, .45);
  filter: brightness(1.08);
}
button.btn:active, a.btn:active { transform: translateY(0); }
button.btn:disabled {
  background: rgba(255, 255, 255, .09);
  color: var(--texto-suave);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

/* Botones secundarios (contorno) */
button.btn-sec, button.btn-ambar, button.btn-peligro {
  background: rgba(255, 255, 255, .04);
  border-radius: 9px;
  padding: 7px 14px;
  font-family: var(--fuente-texto);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transicion), box-shadow var(--transicion), transform var(--transicion);
}
button.btn-sec:hover, button.btn-ambar:hover, button.btn-peligro:hover { transform: translateY(-1px); }

button.btn-sec { color: var(--verde); border: 1px solid rgba(0, 229, 160, .45); }
button.btn-sec:hover { background: var(--verde-claro); box-shadow: 0 0 18px rgba(0, 229, 160, .3); }

button.btn-ambar { color: var(--ambar); border: 1px solid rgba(255, 198, 92, .45); }
button.btn-ambar:hover { background: var(--ambar-claro); box-shadow: 0 0 18px rgba(255, 198, 92, .28); }

button.btn-peligro { color: var(--rojo); border: 1px solid rgba(255, 107, 138, .45); }
button.btn-peligro:hover { background: var(--rojo-claro); box-shadow: 0 0 18px rgba(255, 107, 138, .28); }

/* ---------- Formularios ---------- */
label {
  font-size: .74rem;
  color: var(--texto-suave);
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
}

input, textarea, select {
  font-family: var(--fuente-texto);
  padding: 11px 13px;
  border: 1px solid var(--borde);
  border-radius: 10px;
  font-size: .92rem;
  background: rgba(255, 255, 255, .045);
  color: var(--texto);
  transition: border-color var(--transicion), box-shadow var(--transicion), background var(--transicion);
}
input::placeholder, textarea::placeholder { color: rgba(143, 163, 192, .6); }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--verde);
  background: rgba(255, 255, 255, .07);
  box-shadow: 0 0 0 3px rgba(0, 229, 160, .16), 0 0 20px rgba(0, 229, 160, .16);
}

select option { background: #0b1224; color: var(--texto); }

/* Iconos nativos (fechas) visibles en oscuro */
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1) opacity(.65); cursor: pointer; }

/* ---------- Tablas ---------- */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }

th, td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid rgba(140, 190, 255, .09);
  vertical-align: middle;
}

th {
  color: var(--texto-suave);
  font-weight: 800;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--borde-fuerte);
  background: rgba(255, 255, 255, .022);
}

tbody tr { transition: background var(--transicion); }
tr:hover td { background: rgba(0, 229, 160, .055); }

.num { text-align: right; font-family: var(--fuente-mono); font-variant-numeric: tabular-nums; }

/* ---------- Estados / avisos ---------- */
.pill, .pill-anulada {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .8px;
  text-transform: uppercase;
}
.pill {
  background: var(--verde-claro);
  color: var(--verde);
  border: 1px solid rgba(0, 229, 160, .35);
  box-shadow: 0 0 14px rgba(0, 229, 160, .16) inset;
}
.pill-anulada {
  background: var(--rojo-claro);
  color: var(--rojo);
  border: 1px solid rgba(255, 107, 138, .35);
}

.saldo-pos {
  color: var(--rojo);
  font-weight: 800;
  text-shadow: 0 0 16px rgba(255, 107, 138, .4);
}
.saldo-cero { color: var(--verde); font-weight: 700; }

.aviso {
  padding: 12px 15px;
  background: var(--ambar-claro);
  border: 1px solid rgba(255, 198, 92, .3);
  border-left: 3px solid var(--ambar);
  border-radius: 10px;
  font-size: .85rem;
  color: #ffdb9b;
}
.aviso-error {
  padding: 15px;
  background: var(--rojo-claro);
  border: 1px solid rgba(255, 107, 138, .3);
  border-left: 3px solid var(--rojo);
  border-radius: 10px;
  font-size: .95rem;
  color: #ffc2ce;
  text-align: center;
}

.tarjeta-resumen-deuda {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--rojo-claro);
  border: 1px solid rgba(255, 107, 138, .35);
  border-left: 3px solid var(--rojo);
  border-radius: 10px;
  margin-bottom: 14px;
  font-weight: 600;
}
.tarjeta-resumen-deuda strong {
  color: var(--rojo);
  font-size: 1.3rem;
  font-weight: 800;
  text-shadow: 0 0 16px rgba(255, 107, 138, .4);
}

.oculto { display: none !important; }

/* ---------- Modal ---------- */
.fondo-modal {
  position: fixed; inset: 0;
  background: rgba(3, 6, 14, .78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 100;
  animation: aparecer 200ms ease;
}
.modal {
  position: relative;
  background: linear-gradient(160deg, #101a30, #0a1020);
  border: 1px solid var(--borde-fuerte);
  border-radius: var(--radio);
  padding: 24px;
  max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6), 0 0 0 1px rgba(0, 229, 160, .08);
  animation: subir 240ms cubic-bezier(.2, .9, .3, 1);
}
.modal::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--verde), var(--cian), transparent);
}
.modal h3 {
  font-family: var(--fuente-marca);
  color: var(--verde);
  margin-bottom: 16px;
  font-size: 1.15rem;
  letter-spacing: -.2px;
}

@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
@keyframes subir {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Accesibilidad ---------- */
:focus-visible { outline: 2px solid var(--cian); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
