/**
 * app-theme.css — Tema compartido para área autenticada
 * Usado por: login.html, panel.html, root-panel.html, cambiar-password.html, solicitud.html
 * Define variables globales, componentes comunes y utilidades
 */

:root {
  --panel: #14161a;
  --panel-2: #191b20;
  --line: rgba(237,235,228,0.1);
  --ivory: #EDEBE4;
  --muted: #8B8C93;
  --gold: #D8A24A;
  --gold-soft: rgba(216,162,74,0.14);
  --gold-soft-35: rgba(216,162,74,0.35);
  --cobalt: #4C82FF;
  --cobalt-soft: rgba(76,130,255,0.14);
  --grey-soft: rgba(139,140,147,0.14);
  --green: #34D399;
  --green-soft: rgba(52,211,153,0.14);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* GLOBAL RESET & BASE */
/* ═══════════════════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: #0A0B0D;
  color: var(--ivory);
  font-family: 'Inter', sans-serif;
}

h1, h2, h3, h4, h5, h6 { margin: 0; }
p { margin: 0; }

a {
  color: var(--cobalt);
  text-decoration: none;
  transition: color .2s;
}
a:hover { color: #f0f0f0; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* FORM COMPONENTS */
/* ═══════════════════════════════════════════════════════════════════════════ */

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 7px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: #0A0B0D;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 14px;
  font-size: 14.5px;
  color: var(--ivory);
  font-family: 'Inter', sans-serif;
  transition: border-color .2s, box-shadow .2s;
}

.field input::placeholder,
.field select::placeholder,
.field textarea::placeholder {
  color: #55565c;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold-soft-35);
  box-shadow: 0 0 0 3px rgba(216,162,74,0.12);
}

.field select { cursor: pointer; }
.field select option { background: #14161a; color: var(--ivory); }
.field textarea { resize: vertical; min-height: 100px; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* BUTTONS */
/* ═══════════════════════════════════════════════════════════════════════════ */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--gold), #c88f3a);
  color: #0A0B0D;
  text-decoration: none;
  border: none;
  border-radius: 10px;
  padding: 13px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, opacity .18s;
  box-shadow: 0 6px 20px rgba(216,162,74,0.16);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(216,162,74,0.26);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-cancel,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}

.btn-cancel:hover,
.btn-ghost:hover {
  border-color: var(--gold-soft);
  background: rgba(255,255,255,0.03);
}

.btn-delete-client,
.btn-delete-sol {
  background: transparent;
  color: #e5555b;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(229,85,91,0.3);
  padding: 5px 12px;
  border-radius: 100px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  white-space: nowrap;
  margin-left: auto;
}

.btn-delete-client:hover,
.btn-delete-sol:hover {
  background: rgba(229,85,91,0.12);
  border-color: #e5555b;
}

.btn-add-client {
  background: var(--cobalt);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  border: none;
  padding: 10px 18px;
  border-radius: 100px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  white-space: nowrap;
}

.btn-add-client:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(76,130,255,0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* CARDS & MODALS */
/* ═══════════════════════════════════════════════════════════════════════════ */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 40px 36px;
  max-width: 420px;
  width: 100%;
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--gold-soft-35);
  border-radius: 14px;
  margin-bottom: 20px;
  font-size: 20px;
}

.card h1 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.2;
}

.card p.sub {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 28px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* MODALS */
/* ═══════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-box h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--ivory);
}

.modal-field {
  margin-bottom: 16px;
}

.modal-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.modal-field input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ivory);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}

.modal-field input:focus {
  border-color: var(--gold-soft);
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* BANNERS & NOTIFICATIONS */
/* ═══════════════════════════════════════════════════════════════════════════ */

.error-banner {
  background: rgba(220,90,90,0.1);
  border: 1px solid rgba(220,90,90,0.3);
  color: #e58a8a;
  font-size: 13.5px;
  padding: 11px 14px;
  border-radius: 10px;
  margin-bottom: 18px;
}

.error-banner.hidden {
  display: none;
}

.success-banner {
  background: rgba(52,211,153,0.1);
  border: 1px solid rgba(52,211,153,0.3);
  color: #34D399;
  font-size: 13.5px;
  padding: 11px 14px;
  border-radius: 10px;
  margin-bottom: 18px;
}

.success-banner.hidden {
  display: none;
}

.pwd-banner {
  background: rgba(52,211,153,0.12);
  border: 1px solid rgba(52,211,153,0.3);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--green);
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pwd-banner code {
  background: rgba(0,0,0,0.4);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: monospace;
  font-size: 14px;
  color: var(--green);
  user-select: all;
}

.pwd-close {
  background: transparent;
  border: none;
  color: var(--green);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 200;
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 14px;
  color: var(--ivory);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .3s, transform .3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: rgba(255,70,70,0.4);
  color: #f4a4a4;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* STATUS BADGES */
/* ═══════════════════════════════════════════════════════════════════════════ */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 100px;
  white-space: nowrap;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-badge.activo {
  background: var(--gold-soft);
  color: var(--gold);
}

.status-badge.activo::before {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.status-badge.pendiente {
  background: var(--cobalt-soft);
  color: var(--cobalt);
}

.status-badge.pendiente::before {
  background: var(--cobalt);
}

.status-badge.cancelado {
  background: var(--grey-soft);
  color: var(--muted);
}

.status-badge.cancelado::before {
  background: var(--muted);
}

.status-badge.abierto {
  background: var(--cobalt-soft);
  color: var(--cobalt);
}

.status-badge.abierto::before {
  background: var(--cobalt);
}

.status-badge.en_proceso {
  background: var(--gold-soft);
  color: var(--gold);
}

.status-badge.en_proceso::before {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.status-badge.cerrado {
  background: var(--grey-soft);
  color: var(--muted);
}

.status-badge.cerrado::before {
  background: var(--muted);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* UTILITIES */
/* ═══════════════════════════════════════════════════════════════════════════ */

.hidden {
  display: none !important;
}

.link-quiet {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
}

.link-quiet:hover {
  color: var(--gold);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* RESPONSIVE */
/* ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .modal-box {
    padding: 24px;
  }

  .card {
    padding: 30px 24px;
  }

  .pwd-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .modal-box {
    width: 95%;
  }

  .card {
    max-width: 100%;
  }

  .toast {
    bottom: 20px;
    right: 20px;
    left: 20px;
  }
}
