/* ============================================================
   style.css — Estilos compartidos ids.hfranklin.mx
   Paleta: dark navy + ámbar cálido (mismo sistema que tickets)
   ============================================================ */

/* --- VARIABLES --- */
:root {
  --bg-deep:      oklch(0.19 0.015 255);
  --bg-mid:       oklch(0.24 0.02  255);
  --bg-top:       oklch(0.32 0.03  255);

  --amber:        #9a7240;
  --amber-light:  #b8915a;
  --amber-dim:    #7a5a30;
  --amber-pale:   oklch(0.66 0.1 58 / 0.18);

  --surface:      oklch(0.29 0.02 255 / 0.85);
  --surface-2:    oklch(0.26 0.02 255 / 0.9);
  --border:       oklch(0.68 0.04 68 / 0.14);
  --border-amber: oklch(0.68 0.08 58 / 0.3);

  --text:         oklch(0.94 0.01 75);
  --text-muted:   oklch(0.68 0.03 75);
  --text-dim:     oklch(0.52 0.02 75);

  --success:      oklch(0.64 0.08 160);
  --danger:       oklch(0.61 0.12 28);

  --radius-sm:    6px;
  --radius-md:    12px;
  --radius-lg:    20px;

  --shadow-card:  0 1px 0 rgba(255,255,255,0.06) inset,
                  0 8px 24px rgba(8,10,20,0.32),
                  0 0 0 1px rgba(255,255,255,0.04);

  --header-h:     52px;
  --bottom-h:     64px;
}

/* --- RESET --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  user-select: none;
}

/* Fondo con gradiente + grid punteado (igual que tickets) */
body {
  background:
    radial-gradient(circle at 10% 16%, oklch(0.71 0.06 58 / 0.12) 0%, transparent 22%),
    radial-gradient(circle at 90% 10%, oklch(0.6 0.05 220 / 0.14) 0%, transparent 26%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 52%, var(--bg-deep) 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,0.08), rgba(255,255,255,0.04)),
    url("data:image/svg+xml,%3Csvg width='180' height='180' viewBox='0 0 180 180' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg opacity='0.18'%3E%3Cpath d='M0 89.5H180' stroke='%23B78A58' stroke-width='0.8' stroke-dasharray='2 10'/%3E%3Cpath d='M89.5 0V180' stroke='%23B78A58' stroke-width='0.8' stroke-dasharray='2 10'/%3E%3C/g%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  opacity: 0.3;
  z-index: 0;
}

/* Todo el contenido encima del pseudo-elemento */
body > * { position: relative; z-index: 1; }

/* --- SCROLLBAR --- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--amber-dim); }

/* --- HEADER --- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: oklch(0.17 0.015 255 / 0.92);
  border-bottom: 1px solid var(--border-amber);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 4px 16px rgba(0,0,0,0.3);
}

.header-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.header-title .eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--amber);
  opacity: 0.9;
}

.header-title .main-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* --- TARJETA/PANEL --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
}

/* --- BOTONES --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--amber);
  color: #1a120a;
}
.btn-primary:hover { background: var(--amber-light); }

.btn-secondary {
  background: oklch(0.32 0.02 255 / 0.8);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-secondary:hover { color: var(--text); border-color: var(--border-amber); }

.btn:disabled {
  background: oklch(0.26 0.02 255 / 0.6) !important;
  color: var(--text-dim) !important;
  border-color: transparent !important;
  cursor: not-allowed;
  transform: none !important;
}

/* --- OVERLAY LOADING --- */
.overlay-loading {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  z-index: 1000;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}
.overlay-loading.visible { display: flex; }

.spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(154,114,64,0.2);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- OVERLAY CONFIRMACIÓN --- */
.overlay-confirmacion {
  position: fixed; inset: 0;
  background: oklch(0.18 0.06 160 / 0.97);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  z-index: 1000;
  text-align: center;
  padding: 24px;
}
.overlay-confirmacion.visible { display: flex; }

.confirmacion-icono {
  font-size: 56px;
  animation: pop 0.25s ease-out;
}
@keyframes pop {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}

.confirmacion-texto {
  font-size: 18px;
  font-weight: 700;
  color: oklch(0.88 0.12 160);
}
.confirmacion-timer {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  font-weight: 400;
}

/* --- MODAL IMAGEN --- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}
.modal-overlay.visible { display: flex; }

.modal-img {
  max-width: 90vw; max-height: 90vh;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  object-fit: contain;
}

.modal-close {
  position: fixed; top: 14px; right: 14px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white; font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.modal-close:hover { background: rgba(255,255,255,0.2); }

/* --- ERROR --- */
.mensaje-error {
  background: oklch(0.22 0.06 28 / 0.4);
  border: 1px solid oklch(0.61 0.12 28 / 0.4);
  color: oklch(0.8 0.1 28);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

/* --- FOOTER LINK --- */
.footer-link {
  position: fixed; bottom: 8px; right: 12px;
  font-size: 11px; color: var(--text-dim);
  text-decoration: none; opacity: 0.45;
  z-index: 50;
  transition: opacity 0.15s, color 0.15s;
}
.footer-link:hover { opacity: 1; color: var(--amber); }
