/* ============================================================
   Temas alternos de SIAB
   - data-theme="nexo": violeta profundo estilo NEXO
   - data-theme="jam": crema/berry con la mascota JAM
   El tema base (sin atributo) es SIAB.
   ============================================================ */

/* ---------------- NEXO ---------------- */
html[data-theme="nexo"] {
  color-scheme: dark;
  --overlay-bg: var(--panel);
  --overlay-bg-strong: var(--panel);
  --overlay-blur: blur(18px) saturate(1.2);
  --overlay-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
  --field-bg: rgba(12, 7, 24, 0.78);
  --field-border: rgba(196, 181, 253, 0.2);
  --list-bg: rgba(24, 13, 44, 0.6);
  --table-head: rgba(10, 6, 22, 0.8);
  --bg: #0a0616;
  --bg-soft: #120a24;
  --panel: #160e2a;
  --panel-2: #1e1238;
  --line: rgba(196, 181, 253, 0.16);
  --line-strong: rgba(196, 181, 253, 0.32);
  --text: #f5f3ff;
  --muted: #c4b5fd;
  --muted-2: #a78bfa;
  --accent: #c084fc;
  --accent-2: #f472b6;
  --accent-soft: rgba(192, 132, 252, 0.14);
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #fb7185;
  --on-accent: #ffffff;
  --ok-text: #b9ffe2;
  --ok-bg: rgba(61, 220, 151, 0.12);
  --ok-border: rgba(61, 220, 151, 0.32);
  --warn-text: #ffe2ae;
  --warn-bg: rgba(255, 191, 95, 0.12);
  --warn-border: rgba(255, 191, 95, 0.32);
  --danger-text: #ffc7d1;
  --danger-bg: rgba(255, 107, 129, 0.12);
  --danger-border: rgba(255, 107, 129, 0.3);
  --card-bg: linear-gradient(180deg, rgba(32, 18, 62, 0.94), rgba(14, 8, 28, 0.96));
  --card-flat-bg: rgba(28, 16, 52, 0.72);
  --modal-bg: linear-gradient(180deg, rgba(32, 18, 62, 0.98), rgba(14, 8, 28, 0.98));
  --topbar-bg: rgba(10, 6, 22, 0.84);
  --footer-bg: linear-gradient(90deg, rgba(91, 33, 182, 0.42), rgba(10, 6, 22, 0.78));
  --toast-bg: rgba(24, 13, 44, 0.97);
  --tabs-bg: rgba(12, 7, 24, 0.6);
  --btn-bg: rgba(168, 85, 247, 0.09);
  --hover-bg: rgba(168, 85, 247, 0.12);
  --row-hover: rgba(168, 85, 247, 0.08);
  --pill-bg: rgba(168, 85, 247, 0.12);
  --brand-mark-bg: rgba(168, 85, 247, 0.16);
  --track: rgba(196, 181, 253, 0.2);
  --backdrop: rgba(3, 7, 14, 0.72);
  --shadow: 0 24px 60px rgba(76, 29, 149, 0.45);
}

html[data-theme="nexo"] body {
  background:
    radial-gradient(1100px 560px at 12% -10%, rgba(124, 58, 237, 0.35), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(236, 72, 153, 0.16), transparent 55%),
    var(--bg);
}

html[data-theme="nexo"] .topbar {
  background: rgba(10, 6, 22, 0.84);
  border-bottom-color: rgba(196, 181, 253, 0.2);
}

html[data-theme="nexo"] .app-footer {
  background: linear-gradient(90deg, rgba(91, 33, 182, 0.42), rgba(10, 6, 22, 0.78));
  border-top: 1px solid rgba(196, 181, 253, 0.2);
  box-shadow: inset 0 2px 0 0 #7c3aed;
}

html[data-theme="nexo"] .card {
  background: linear-gradient(180deg, rgba(32, 18, 62, 0.94), rgba(14, 8, 28, 0.96));
  border-color: rgba(196, 181, 253, 0.18);
}

html[data-theme="nexo"] .card.flat {
  background: rgba(28, 16, 52, 0.72);
}

html[data-theme="nexo"] .field input,
html[data-theme="nexo"] .field select {
  background: rgba(12, 7, 24, 0.78);
  border-color: rgba(196, 181, 253, 0.2);
}

html[data-theme="nexo"] .field input:focus,
html[data-theme="nexo"] .field select:focus {
  border-color: rgba(192, 132, 252, 0.65);
  box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.16);
}

html[data-theme="nexo"] .btn {
  background: rgba(168, 85, 247, 0.09);
  border-color: rgba(196, 181, 253, 0.3);
}

html[data-theme="nexo"] .btn:hover:not(:disabled) {
  border-color: rgba(192, 132, 252, 0.6);
  background: rgba(168, 85, 247, 0.18);
}

html[data-theme="nexo"] .btn.primary {
  background: linear-gradient(135deg, #7c3aed, #c026d3);
  color: #fff;
  border-color: transparent;
}

html[data-theme="nexo"] .main-nav a.active {
  background: linear-gradient(135deg, #7c3aed, #c026d3);
  color: #fff;
}

html[data-theme="nexo"] .badge {
  background: rgba(12, 7, 24, 0.75);
}

html[data-theme="nexo"] .list-item {
  background: rgba(24, 13, 44, 0.6);
}

html[data-theme="nexo"] thead th {
  background: rgba(10, 6, 22, 0.8);
}

html[data-theme="nexo"] .login-inst {
  background: rgba(20, 11, 38, 0.78);
}

html[data-theme="nexo"] .brand-mark {
  background: rgba(168, 85, 247, 0.16);
  border-color: rgba(196, 181, 253, 0.32);
}

html[data-theme="nexo"] .modal-card {
  background: linear-gradient(180deg, rgba(32, 18, 62, 0.98), rgba(14, 8, 28, 0.98));
}

html[data-theme="nexo"] .toast {
  background: rgba(24, 13, 44, 0.97);
}

html[data-theme="nexo"] .result-card {
  background: rgba(15, 9, 30, 0.94);
}

html[data-theme="nexo"] .kiosk-stage {
  background: #0a0514;
}

html[data-theme="nexo"] .kiosk-prompt {
  background: rgba(10, 6, 22, 0.78);
  border-color: var(--line);
  color: var(--text);
}

html[data-theme="nexo"] .login-brand-logo {
  content: url("/assets/brand/siab-logo-dark.svg");
}

/* ---------------- JAM ---------------- */
html[data-theme="jam"] {
  color-scheme: light;
  --overlay-bg: var(--panel);
  --overlay-bg-strong: var(--panel);
  --overlay-blur: blur(18px) saturate(1.2);
  --overlay-shadow: 0 18px 45px rgba(190, 18, 60, 0.18);
  --field-bg: #fffaf7;
  --field-border: #fecdd3;
  --list-bg: #fff7f3;
  --table-head: #ffe4e6;
  --bg: #fff8f0;
  --bg-soft: #fff1e6;
  --panel: #ffffff;
  --panel-2: #fff3e9;
  --line: rgba(190, 18, 60, 0.14);
  --line-strong: rgba(190, 18, 60, 0.28);
  --text: #3b0a1e;
  --muted: #7c2d4a;
  --muted-2: #9f5b72;
  --accent: #be123c;
  --accent-2: #7c3aed;
  --accent-soft: rgba(190, 18, 60, 0.08);
  --ok: #15803d;
  --warn: #b45309;
  --danger: #dc2626;
  --on-accent: #ffffff;
  --ok-text: #166534;
  --ok-bg: #dcfce7;
  --ok-border: #86efac;
  --warn-text: #92400e;
  --warn-bg: #fef3c7;
  --warn-border: #fcd34d;
  --danger-text: #9f1239;
  --danger-bg: #ffe4e6;
  --danger-border: #fda4af;
  --card-bg: #ffffff;
  --card-flat-bg: #fff7f3;
  --modal-bg: #ffffff;
  --topbar-bg: rgba(255, 248, 240, 0.92);
  --footer-bg: #3b0a1e;
  --toast-bg: #ffffff;
  --tabs-bg: #fff7f3;
  --btn-bg: #ffffff;
  --hover-bg: #ffe4e6;
  --row-hover: #ffe4e6;
  --pill-bg: #ffe4e6;
  --brand-mark-bg: #3b0a1e;
  --track: rgba(190, 18, 60, 0.18);
  --backdrop: rgba(59, 10, 30, 0.45);
  --shadow: 0 20px 50px rgba(190, 18, 60, 0.14);
}

html[data-theme="jam"] body {
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(251, 113, 133, 0.24), transparent 60%),
    radial-gradient(850px 500px at 100% 0%, rgba(168, 85, 247, 0.16), transparent 55%),
    var(--bg);
  color: var(--text);
}

html[data-theme="jam"] .topbar {
  background: rgba(255, 248, 240, 0.92);
  border-bottom-color: var(--line);
}

html[data-theme="jam"] .brand-text strong {
  color: #3b0a1e;
}

html[data-theme="jam"] .brand-text small {
  color: var(--muted-2);
}

html[data-theme="jam"] .brand-mark {
  background: #3b0a1e;
  border-color: #7c2d4a;
}

html[data-theme="jam"] .main-nav a {
  color: var(--muted);
}

html[data-theme="jam"] .main-nav a:hover {
  color: #3b0a1e;
  background: #ffe4e6;
}

html[data-theme="jam"] .main-nav a.active {
  background: linear-gradient(135deg, #be123c, #e11d48);
  color: #fff;
}

html[data-theme="jam"] .user-chip span {
  color: var(--muted-2);
}

html[data-theme="jam"] .btn {
  background: #fff;
  border-color: #fecdd3;
  color: #7c2d4a;
}

html[data-theme="jam"] .btn:hover:not(:disabled) {
  border-color: #fda4af;
  background: #ffe4e6;
}

html[data-theme="jam"] .btn.primary {
  background: linear-gradient(135deg, #be123c, #e11d48);
  color: #fff;
  border-color: transparent;
}

html[data-theme="jam"] .btn.danger {
  color: #9f1239;
  background: #ffe4e6;
  border-color: #fda4af;
}

html[data-theme="jam"] .card {
  background: var(--panel);
  border-color: #fecdd3;
  box-shadow: var(--shadow);
}

html[data-theme="jam"] .card.flat {
  background: #fff7f3;
}

html[data-theme="jam"] .field input,
html[data-theme="jam"] .field select {
  background: #fffaf7;
  border-color: #fecdd3;
  color: var(--text);
}

html[data-theme="jam"] .field input:focus,
html[data-theme="jam"] .field select:focus {
  border-color: #fb7185;
  box-shadow: 0 0 0 3px rgba(190, 18, 60, 0.12);
}

html[data-theme="jam"] .badge {
  background: #fff0f3;
  border-color: #fecdd3;
  color: #9f1239;
}

html[data-theme="jam"] .badge.ok {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}

html[data-theme="jam"] .badge.warn {
  color: #92400e;
  background: #fef3c7;
  border-color: #fcd34d;
}

html[data-theme="jam"] .badge.danger {
  color: #9f1239;
  background: #ffe4e6;
  border-color: #fda4af;
}

html[data-theme="jam"] .list-item {
  background: #fff;
  border-color: #fecdd3;
}

html[data-theme="jam"] .table-wrap {
  border-color: #fecdd3;
}

html[data-theme="jam"] thead th {
  background: #3b0a1e;
  color: #fff;
}

html[data-theme="jam"] tbody td {
  border-bottom-color: #fecdd3;
}

html[data-theme="jam"] tbody tr:nth-child(even) td {
  background: #fff7f3;
}

html[data-theme="jam"] tbody tr:hover td {
  background: #ffe4e6;
}

html[data-theme="jam"] .pill {
  background: #ffe4e6;
  border-color: #fecdd3;
  color: #9f1239;
}

html[data-theme="jam"] .login-inst {
  background: #fff;
  border-color: #fecdd3;
  box-shadow: 0 10px 30px rgba(190, 18, 60, 0.12);
}

html[data-theme="jam"] .login-inst-text strong {
  color: #3b0a1e;
}

html[data-theme="jam"] .login-inst-text small {
  color: var(--muted-2);
}

html[data-theme="jam"] .login-card .brand-mark {
  background: #3b0a1e;
  border-color: #7c2d4a;
}

html[data-theme="jam"] .modal-card {
  background: #fff;
  border-color: #fecdd3;
}

html[data-theme="jam"] .toast {
  background: #fff;
  color: #3b0a1e;
  border-color: #fecdd3;
}

html[data-theme="jam"] .toast.ok {
  border-color: #86efac;
}

html[data-theme="jam"] .toast.error {
  border-color: #fda4af;
}

html[data-theme="jam"] .toast.warn {
  border-color: #fcd34d;
}

html[data-theme="jam"] .app-footer {
  background: #3b0a1e;
  color: #ffe4e6;
  border-top: 1px solid rgba(255, 228, 230, 0.24);
  box-shadow: inset 0 2px 0 0 #be123c;
}

html[data-theme="jam"] .app-footer p {
  color: #fecdd3;
}

html[data-theme="jam"] .footer-brand {
  color: #ffe4e6;
}

html[data-theme="jam"] .footer-inst {
  border-left-color: rgba(255, 228, 230, 0.24);
}

html[data-theme="jam"] .footer-link {
  color: #fecdd3;
}

html[data-theme="jam"] .theme-picker {
  color: #ffe4e6;
}

html[data-theme="jam"] .theme-picker select {
  background: #fff;
  color: #3b0a1e;
  border-color: #fecdd3;
}

html[data-theme="jam"] .kiosk-stage {
  background: #1a0b12;
}

/* ---------------- Mascota JAM ---------------- */
.jam-hero,
.jam-footer-mascot {
  display: none;
}

html[data-theme="jam"] .jam-hero {
  display: flex;
  position: absolute;
  left: calc(100% + 1.25rem);
  bottom: 0;
  z-index: 1;
  align-items: center;
  gap: 10px;
  margin: 0;
  width: max-content;
  max-width: min(22rem, 38vw);
}

@media (max-width: 1399px) {
  html[data-theme="jam"] .jam-hero {
    display: none;
  }
}

.jam-hero img {
  width: 118px;
  height: auto;
  filter: drop-shadow(0 14px 20px rgba(190, 18, 60, 0.22));
}

.jam-bubble {
  padding: 9px 13px;
  border-radius: 14px;
  border: 1px solid #fecdd3;
  background: #fff;
  color: #9f1239;
  font-weight: 700;
  font-size: 0.78125rem;
  box-shadow: 0 10px 24px rgba(190, 18, 60, 0.12);
  position: relative;
}

.jam-bubble::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid #fecdd3;
  border-bottom: 1px solid #fecdd3;
  transform: translateY(-50%) rotate(45deg);
}

@media (max-width: 560px) {
  .jam-hero img {
    width: 92px;
  }
  .jam-bubble {
    font-size: 0.71875rem;
    padding: 7px 10px;
  }
}

/* ---------------- Selector de diseño ---------------- */
.theme-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.71875rem;
  color: var(--muted-2);
  white-space: nowrap;
}

.theme-picker select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 7px;
  font-size: 0.71875rem;
  cursor: pointer;
}

.theme-picker select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* ---------------- Archivos ---------------- */
input[type="file"] {
  font-size: 0.78125rem;
  color: var(--muted);
  max-width: 100%;
}

input[type="file"]::file-selector-button {
  margin-right: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
  border-color: var(--accent);
}

html[data-theme="jam"] input[type="file"]::file-selector-button {
  background: #ffe4e6;
  color: #9f1239;
  border-color: #fda4af;
}

/* ---------------- Ajustes de componentes ---------------- */
html[data-theme="jam"] .enroll-tabs {
  background: #fff7f3;
  border-color: #fecdd3;
}

html[data-theme="jam"] .tab-btn {
  color: #7c2d4a;
}

html[data-theme="jam"] .tab-btn:hover {
  color: #3b0a1e;
  background: #ffe4e6;
}

html[data-theme="jam"] .tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, #be123c, #e11d48);
}

html[data-theme="nexo"] .enroll-tabs {
  background: rgba(12, 7, 24, 0.6);
  border-color: var(--line);
}

html[data-theme="nexo"] .tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #c026d3);
}

html[data-theme="jam"] .curp-status {
  background: #fff7f3;
  border-color: #fecdd3;
  color: #7c2d4a;
}

html[data-theme="jam"] .curp-status.ok {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

html[data-theme="jam"] .curp-status.warn {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

html[data-theme="jam"] .curp-status.err {
  background: #ffe4e6;
  border-color: #fda4af;
  color: #9f1239;
}

html[data-theme="jam"] .file-drop {
  background: #fff7f3;
  border-color: #fecdd3;
}

/* El video del kiosco siempre es oscuro: conserva texto claro encima. */
html[data-theme="jam"] .kiosk-stage {
  --text: #eaf2ff;
  --muted: #93a6c4;
  --muted-2: #6d809f;
  --line: rgba(148, 178, 219, 0.2);
  --line-strong: rgba(148, 178, 219, 0.35);
  color: #eaf2ff;
}

/* Selector de Diseño sobre el pie oscuro de NEXO. */
html[data-theme="nexo"] .theme-picker select {
  color: #f5f3ff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(196, 181, 253, 0.35);
}

/* El video del estacionamiento también es oscuro. */
html[data-theme="jam"] .parking-stage {
  --text: #eaf2ff;
  --muted: #93a6c4;
  --muted-2: #6d809f;
  --line: rgba(148, 178, 219, 0.2);
  --line-strong: rgba(148, 178, 219, 0.35);
  color: #eaf2ff;
}

html[data-theme="jam"] input[type="checkbox"],
html[data-theme="jam"] input[type="radio"] {
  accent-color: #be123c;
}

html[data-theme="nexo"] input[type="checkbox"],
html[data-theme="nexo"] input[type="radio"] {
  accent-color: #a855f7;
}

html[data-theme="jam"] .fp-icon {
  border-color: #fecdd3;
}

html[data-theme="nexo"] .fp-icon {
  border-color: rgba(196, 181, 253, 0.3);
}

html[data-theme="jam"] .faceid-dot.active {
  box-shadow: 0 0 0 4px rgba(190, 18, 60, 0.15);
}
