/* ============================================================
   BOTICA BARCIA — Portal de Asistencia v5
   Paleta institucional: Verde bosque #1B6B45
   Diseño premium con identidad corporativa
   ============================================================ */

/* Fuentes AUTO-ALOJADAS. Google Fonts está bloqueado por CSP en producción,
   así que no se usa @import; cada familia es un woff2 variable local. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/inter.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/jetbrains-mono.woff2') format('woff2');
}
/* Playfair Display — títulos serif. Fuente variable, cubre pesos 400–700. */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/playfair-display.woff2') format('woff2');
}

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

:root {
  --barra-verde-h: 72px;   /* alto único de la franja verde superior en TODAS las pantallas */
  --verde-bb:     #1B6B45;
  --verde-bb2:    #0F5C38;
  --verde-medio:  #2E8B57;
  --verde-claro:  #4CAF7D;
  --verde-acento: #5CC48A;
  --carbon:       #141A17;
  --carbon2:      #1D2620;
  --carbon3:      #253029;
  --crema:        #F5F0E8;
  --crema2:       #E8E2D6;
  --gris:         #8A9E92;
  --gris-claro:   #B8C8BC;
  --rojo:         #E05252;
  --dorado:       #C9A84C;
  --shadow:       0 12px 40px rgba(0,0,0,0.5);
  --radius:       14px;
  --radius-sm:    9px;
  --serif:        'Playfair Display', Georgia, 'Times New Roman', serif;
  /* Verde de MARCA Botica — FIJO. Ningún bloque de tema lo redefine,
     así los elementos de identidad del login (banners, CONTROL DE
     ASISTENCIA, botones) se mantienen verdes con cualquier tema. */
  --verde-botica: #175C3C;
}

/* ============================================================
   TEMAS — seleccionables desde Ajustes (Panel admin).
   Cada bloque redefine solo las variables de superficie, texto
   y marca (verde-*). --rojo, --dorado y --verde-acento quedan
   fijas en todos los temas: son semánticas (peligro / alerta /
   positivo-activo), no de marca — así una pill "TARDANZA" o un
   estado "OK" se leen igual sin importar el tema elegido.
   "actual" es el default y no necesita bloque: ya es el :root.
   ============================================================ */

:root[data-tema="claro"] {
  --carbon:       #F7F5F0;
  --carbon2:      #FFFFFF;
  --carbon3:      #ECE7DD;
  --crema:        #1D2620;
  --crema2:       #3A453D;
  --gris:         #6E7D73;
  --gris-claro:   #8FA095;
  --verde-bb:     #1B6B45;
  --verde-bb2:    #0F5C38;
  --verde-medio:  #2E8B57;
  --verde-claro:  #217A4E;
}

/* "Barcia Clásico" — tema institucional extraído del rediseño de
   referencia y de la fachada de la botica matriz: verde bosque
   profundo (#175C3C, header/marca), acento terracota tomado de los
   detalles de la fachada (#D07C3F), fondo crema cálido (#FAF5EC) y
   tarjetas blancas. Es el tema activo por defecto del sistema.
   (--verde-bb2 se usa como el acento naranja, igual que antes.) */
:root[data-tema="botica-barcia"] {
  --carbon:       #FAF5EC;
  --carbon2:      #FFFFFF;
  --carbon3:      #F0E9DA;
  --crema:        #123B28;
  --crema2:       #35543F;
  --gris:         #6E7A72;
  --gris-claro:   #8C968C;
  --verde-bb:     #175C3C;
  --verde-bb2:    #D07C3F;
  --verde-medio:  #1F7A4D;
  --verde-claro:  #2E8B57;
}

/* Fundación José Barcia Bravo: papel cálido, grafito del retrato,
   dorado del rótulo "FUNDACIÓN". Sin verde — reemplaza la familia
   verde-* por dorado/grafito. */
:root[data-tema="fundacion"] {
  --carbon:       #FAF7F0;
  --carbon2:      #FFFFFF;
  --carbon3:      #F0EBDD;
  --crema:        #33383D;
  --crema2:       #4B5158;
  --gris:         #838A86;
  --gris-claro:   #A8AFA9;
  --verde-bb:     #B08A2E;
  --verde-bb2:    #4B5158;
  --verde-medio:  #9C7A28;
  --verde-claro:  #C79A3C;
}

/* Alto contraste — accesibilidad, negro/blanco puro. */
:root[data-tema="alto-contraste"] {
  --carbon:       #000000;
  --carbon2:      #0A0A0A;
  --carbon3:      #1A1A1A;
  --crema:        #FFFFFF;
  --crema2:       #F2F2F2;
  --gris:         #C7C7C7;
  --gris-claro:   #E5E5E5;
  --verde-bb:     #3DDC84;
  --verde-bb2:    #2BB86E;
  --verde-medio:  #34C97A;
  --verde-claro:  #5CE39C;
}

/* Azul clínico — alternativa neutra sin verde, común en software de salud. */
:root[data-tema="azul-clinico"] {
  --carbon:       #12161C;
  --carbon2:      #1A212B;
  --carbon3:      #222B37;
  --crema:        #EDF1F5;
  --crema2:       #D7DEE6;
  --gris:         #8593A3;
  --gris-claro:   #AAB6C2;
  --verde-bb:     #2E6FA7;
  --verde-bb2:    #1F4E78;
  --verde-medio:  #3E82BE;
  --verde-claro:  #4FA3D9;
}

/* Sepia nocturno — cálido, bajo en azul, para turnos de madrugada. */
:root[data-tema="sepia"] {
  --carbon:       #1C1712;
  --carbon2:      #26201A;
  --carbon3:      #322A21;
  --crema:        #F0E4D0;
  --crema2:       #DFCFB4;
  --gris:         #A38F72;
  --gris-claro:   #C4B190;
  --verde-bb:     #8A6D3B;
  --verde-bb2:    #6B5228;
  --verde-medio:  #9C7D45;
  --verde-claro:  #C98A3D;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--carbon);
  color: var(--crema);
  min-height: 100vh;
  overflow-x: hidden;
}

.page { display: none; min-height: 100vh; }
.page.active { display: flex; }

/* ══════════════════════════════════════════════════════════════
   LOGIN — 3 columnas: logo BB | contenido | logo FJB + formulario
══════════════════════════════════════════════════════════════ */
#page-login {
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
  min-height: 100vh;
  padding: 24px;
}

.login-wrapper {
  display: flex;
  width: 100%;
  max-width: 1100px;
  min-height: 580px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.65);
}

/* ── COLUMNA LOGOS: logo BB arriba, logo FJB abajo ── */
.login-logos-col {
  width: 200px;
  flex-shrink: 0;
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 32px 16px;
}
.login-logo-bb {
  width: 160px;
  height: 160px;
  object-fit: contain;
  border-radius: 12px;
}
.login-logo-fjb {
  width: 160px;
  height: 160px;
  object-fit: contain;
}

/* ── PANEL CENTRAL: blanco con visión misión etc ── */
.login-brand {
  flex: 1;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 28px 28px 24px;
}
.login-brand::-webkit-scrollbar { width: 3px; }
.login-brand::-webkit-scrollbar-thumb { background: #ccc; }

/* Separador horizontal */
.login-sep {
  border: none;
  border-top: 1px solid #c8d8cc;
  margin: 10px 0;
}

/* Sección */
.login-section { margin-bottom: 4px; }

/* Banners SVG */
.bb-banner {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}
.bb-banner-svg { display: block; overflow: visible; }
/* El fill="#1B6B45" en el <path> es solo el color de respaldo sin CSS —
   esta regla gana por especificidad y sigue el tema activo. */
.bb-banner-svg path { fill: var(--verde-bb); }
.bb-banner-label {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-anchor: middle;
  dominant-baseline: central;
}

/* Texto */
.login-section-text {
  font-size: 12.5px;
  color: #1a3a2a;
  line-height: 1.65;
  text-align: center;
  font-family: Georgia, 'Times New Roman', serif;
  padding: 0 4px;
}
.login-section-list {
  list-style: none;
  padding: 0 4px;
  margin: 0;
}
.login-section-list li {
  font-size: 12.5px;
  color: #1a3a2a;
  line-height: 1.6;
  text-align: center;
  padding: 2px 0;
  font-family: Georgia, 'Times New Roman', serif;
}
.login-section-list li::before { content: '• '; color: var(--verde-bb); }

/* ── PANEL DERECHO: formulario oscuro ── */
.login-form-panel {
  width: 340px;
  flex-shrink: 0;
  background: var(--carbon2);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 100; /* siempre por encima de los post-it, aunque se arrastren encima */
}
.login-form-banner {
  background: var(--verde-bb);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
  padding: 12px 16px;
  border-radius: 6px;
  margin: 18px 22px 0;
}
.login-form-body {
  flex: 1;
  padding: 20px 22px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-form-body h2 {
  font-size: 24px; font-weight: 700;
  color: var(--crema); margin-bottom: 5px;
}
.login-form-body > p {
  font-size: 13px; color: var(--gris);
  margin-bottom: 22px; line-height: 1.5;
}
.form-group { margin-bottom: 13px; }
.form-group label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--gris-claro); margin-bottom: 5px;
  letter-spacing: .07em; text-transform: uppercase;
}
.form-group input,
.form-group select {
  width: 100%; padding: 10px 13px;
  background: var(--carbon3);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  color: var(--crema); font-size: 13px;
  font-family: 'Inter', sans-serif;
  transition: border-color .2s;
  outline: none; appearance: none;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--verde-medio);
  box-shadow: 0 0 0 3px rgba(46,139,87,0.18);
}
.form-group select option { background: var(--carbon3); color: var(--crema); }
.form-group input::placeholder { color: var(--gris); }
.btn-primary {
  width: 100%; padding: 12px;
  background: var(--verde-bb);
  border: none; border-radius: 8px;
  color: #fff; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: opacity .2s;
  letter-spacing: .05em; text-transform: uppercase; margin-top: 5px;
}
.btn-primary:hover { opacity: .88; }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
/* Acción alternativa del login (volver a intentar el rostro): visible pero
   sin competir con el botón principal del paso actual. */
.btn-secundario {
  width: 100%; padding: 11px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  color: var(--gris-claro); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: border-color .2s, color .2s;
  letter-spacing: .05em; text-transform: uppercase; margin-top: 8px;
}
.btn-secundario:hover { border-color: var(--verde-medio); color: var(--crema); }
/* Campo cargado por el sistema y bloqueado (empresa/sucursal del empleado
   antes de que un supervisor autorice el ingreso). */
.form-group input:disabled,
.form-group select:disabled {
  opacity: .6; cursor: not-allowed;
  background: rgba(255,255,255,0.03);
}
.error-msg {
  background: rgba(224,82,82,0.12); border: 1px solid rgba(224,82,82,0.3);
  color: #F08080; border-radius: 8px;
  padding: 9px 13px; font-size: 12px; margin-bottom: 12px; display: none;
}
.msg-ok  {
  background: rgba(92,196,138,0.1); border: 1px solid rgba(92,196,138,0.3);
  color: var(--verde-acento); border-radius: 8px;
  padding: 12px; font-size: 13px; margin-bottom: 16px; display: none;
}
.msg-err {
  background: rgba(224,82,82,0.1); border: 1px solid rgba(224,82,82,0.3);
  color: #F09090; border-radius: 8px;
  padding: 12px; font-size: 13px; margin-bottom: 16px; display: none;
}

/* ══════════════════════════════════════════════════════════════
   MARCACIÓN — con panel lateral de código de ética
══════════════════════════════════════════════════════════════ */
#page-marcacion {
  flex-direction: column;
  background: var(--carbon);
}

/* Header slim */
.marcacion-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px;
  background: var(--carbon2);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  position: relative; z-index: 100; /* por encima de los post-it, aunque se arrastren encima */
}
.header-brand { display: flex; align-items: center; gap: 10px; }
.header-logo  { height: 34px; border-radius: 6px; object-fit: contain; }
.header-logo.bb  { background: var(--verde-bb); padding: 3px 7px; }
.header-logo.fjb { background: white; padding: 2px 5px; }
.header-info-name { font-size: 13px; font-weight: 600; color: var(--crema); }
.header-info-sub  { font-size: 11px; color: var(--gris); }

.header-right { display: flex; align-items: center; gap: 10px; }
.usuario-chip {
  background: rgba(46,139,87,0.15);
  border: 1px solid rgba(46,139,87,0.3);
  border-radius: 20px; padding: 5px 14px;
  font-size: 12px; color: var(--verde-acento); font-weight: 500;
  max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn-salir {
  padding: 6px 14px; background: transparent;
  border: 1px solid rgba(255,255,255,0.1); border-radius: 7px;
  color: var(--gris); font-size: 12px; cursor: pointer;
  transition: all .2s; font-family: 'Inter', sans-serif;
}
.btn-salir:hover { border-color: var(--rojo); color: var(--rojo); }

/* Botón Mi Dashboard / acciones secundarias del header */
.btn-mi-dashboard, .btn-header-secundario {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; background: rgba(27,107,69,0.15);
  border: 1px solid rgba(27,107,69,0.35); border-radius: 8px;
  color: var(--verde-acento); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .2s; font-family: 'Inter', sans-serif;
}
.btn-mi-dashboard:hover, .btn-header-secundario:hover { background: rgba(27,107,69,0.25); }
.btn-mi-dashboard svg, .btn-header-secundario svg { stroke: currentColor; }

/* Modal genérico (cambio de contraseña, etc.) */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-box {
  background: var(--carbon2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  width: 560px; max-width: 92vw;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 15px; font-weight: 600; color: var(--crema);
}
.modal-close {
  background: none; border: none; color: var(--gris);
  font-size: 16px; cursor: pointer; padding: 2px 6px;
  border-radius: 4px; transition: color .15s;
}
.modal-close:hover { color: var(--rojo); }
.modal-body { padding: 20px; overflow-y: auto; }

/* ── Cuerpo con layout de dos columnas ── */
.marcacion-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Panel central: reloj + marcación */
.marcacion-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  gap: 20px;
}

/* Reloj grande */
.reloj-bloque { text-align: center; }
.reloj-digital {
  font-family: 'JetBrains Mono', monospace;
  font-size: 72px; font-weight: 300;
  color: var(--verde-acento); letter-spacing: 6px; line-height: 1;
  text-shadow: 0 0 40px rgba(92,196,138,0.2);
}
.reloj-fecha { font-size: 14px; color: var(--gris); margin-top: 8px; letter-spacing: .05em; }

/* Tarjeta de marcación */
.marcacion-card {
  background: var(--carbon2);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px; padding: 28px 32px;
  width: 100%; max-width: 560px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 100; /* siempre por encima de los post-it, aunque se arrastren encima */
}

.empleado-info {
  display: flex; align-items: center; gap: 14px;
  background: rgba(27,107,69,0.12);
  border: 1px solid rgba(27,107,69,0.3);
  border-radius: var(--radius-sm); padding: 13px 16px; margin-bottom: 22px;
}
.emp-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, var(--verde-medio), var(--verde-bb2));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: white; flex-shrink: 0;
}
.emp-nombre { font-size: 15px; font-weight: 600; color: var(--crema); }
.emp-sub    { font-size: 12px; color: var(--gris); margin-top: 3px; }

.marcacion-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 14px;
}

.btn-marcacion {
  position: relative; padding: 20px 14px;
  background: var(--carbon3);
  border: 1.5px solid rgba(255,255,255,0.07);
  border-radius: var(--radius); cursor: pointer;
  text-align: center; transition: all .2s;
  color: var(--crema); font-family: 'Inter', sans-serif;
}
.btn-marcacion:hover:not(:disabled) {
  border-color: var(--verde-medio);
  background: rgba(46,139,87,0.1);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(27,107,69,0.25);
}
.btn-marcacion.activo {
  border-color: var(--verde-acento);
  background: rgba(46,139,87,0.15);
  box-shadow: 0 0 0 2px rgba(92,196,138,0.2);
}
.btn-marcacion.registrado {
  border-color: rgba(92,196,138,0.4);
  background: rgba(27,107,69,0.15); opacity: .8;
}
.btn-marcacion:disabled:not(.registrado) { opacity: .28; cursor: not-allowed; transform: none; }
.btn-marcacion.registrado { cursor: default; transform: none !important; }
.btn-marcacion .btn-icono { width: 34px; height: 34px; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; }
.btn-marcacion .btn-icono svg { width: 100%; height: 100%; }
.btn-marcacion .btn-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; display: block; color: var(--crema2); }
.btn-marcacion .btn-hora  { font-size: 13px; color: var(--verde-acento); margin-top: 6px; font-family: 'JetBrains Mono', monospace; display: block; min-height: 20px; font-weight: 600; letter-spacing: 1px; }
.check-mark {
  position: absolute; top: 9px; right: 9px;
  width: 18px; height: 18px; background: var(--verde-medio);
  border-radius: 50%; display: none; align-items: center; justify-content: center;
}
.check-mark svg { width: 10px; height: 10px; stroke: white; fill: none; }
.btn-marcacion.registrado .check-mark { display: flex; }

.btn-registrar {
  width: 100%; padding: 15px;
  background: linear-gradient(135deg, var(--verde-medio), var(--verde-bb));
  border: none; border-radius: var(--radius-sm);
  color: #fff; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .2s; letter-spacing: .08em; text-transform: uppercase;
}
.btn-registrar:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(27,107,69,0.4); }
.btn-registrar:active  { transform: scale(.98); }
.btn-registrar:disabled { opacity: .35; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Panel lateral: Código de Ética ── */
.etica-panel {
  width: 320px;
  flex-shrink: 0;
  background: var(--carbon2);
  border-left: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.etica-header {
  background: linear-gradient(135deg, var(--verde-bb), var(--verde-bb2));
  padding: 16px 20px;
  text-align: center;
  flex-shrink: 0;
}
.etica-header-title {
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(255,255,255,0.7); margin-bottom: 4px;
}
.etica-header-sub {
  font-size: 13px; font-weight: 600; color: white;
}

.etica-valores {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.etica-valores::-webkit-scrollbar { width: 4px; }
.etica-valores::-webkit-scrollbar-track { background: transparent; }
.etica-valores::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.etica-valor-card {
  background: var(--carbon3);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid var(--verde-medio);
  border-radius: 10px;
  padding: 14px 16px;
}
.etica-valor-card:nth-child(2) { border-left-color: var(--dorado); }
.etica-valor-card:nth-child(3) { border-left-color: var(--verde-acento); }

.etica-valor-titulo {
  font-size: 12px; font-weight: 700; color: var(--verde-acento);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.etica-valor-card:nth-child(2) .etica-valor-titulo { color: var(--dorado); }
.etica-valor-card:nth-child(3) .etica-valor-titulo { color: var(--verde-claro); }

.etica-valor-icon { width: 16px; height: 16px; }
.etica-valor-icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; }

.etica-item {
  display: flex; gap: 8px; margin-bottom: 7px;
  font-size: 11px; line-height: 1.55; color: var(--gris-claro);
  align-items: flex-start;
}
.etica-item:last-child { margin-bottom: 0; }
.etica-item::before {
  content: '';
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--verde-medio); flex-shrink: 0; margin-top: 5px;
}
.etica-valor-card:nth-child(2) .etica-item::before { background: var(--dorado); }
.etica-valor-card:nth-child(3) .etica-item::before { background: var(--verde-acento); }

.etica-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.05);
  text-align: center;
  flex-shrink: 0;
}
.etica-lema {
  font-size: 10px; color: var(--gris); font-style: italic; line-height: 1.5;
}
.etica-lema strong { color: var(--verde-acento); font-style: normal; }

/* Toast */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(90px);
  background: var(--carbon2); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 13px 22px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow); transition: transform .35s cubic-bezier(.34,1.56,.64,1);
  z-index: 9999; display: flex; align-items: center; gap: 10px; max-width: 420px;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.ok  { border-color: rgba(92,196,138,0.45); color: var(--verde-acento); }
.toast.err { border-color: rgba(224,82,82,0.45);  color: #F09090; }

.spinner {
  display: inline-block; width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite; vertical-align: middle; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.5; transform:scale(1.3); }
}

@media (max-width: 768px) {
  .login-brand { display: none; }
  .login-form-panel { width: 100%; }
  .etica-panel { display: none; }
}



/* ══════════════════════════════════════════════════════════════
   LOGIN — layout 50/50, fondo blanco izq, oscuro der
══════════════════════════════════════════════════════════════ */
#page-login {
  align-items: center;
  justify-content: center;
  background: var(--carbon);
  min-height: 100vh;
  padding: 24px;
}

.login-wrapper {
  display: flex;
  width: 100%;
  max-width: 960px;
  min-height: 600px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.65);
}

/* ── PANEL IZQUIERDO: blanco, idéntico al diseño corporativo ── */
.login-brand {
  flex: 1.1;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Logos centrados arriba */
.login-brand-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}
.login-logo-bb {
  height: 64px;
  object-fit: contain;
}
.login-logo-fjb {
  height: 67px;
  object-fit: contain;
}

/* Contenido scrollable */
.login-brand-content {
  flex: 1;
  padding: 18px 22px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #ffffff;
  scrollbar-width: thin;
  scrollbar-color: var(--gris-claro) transparent;
}
.login-brand-content::-webkit-scrollbar { width: 3px; }
.login-brand-content::-webkit-scrollbar-thumb { background: var(--gris-claro); border-radius: 2px; }

/* ══════════════════════════════════════════════════════════════
   CUADRO BB — esquinas cóncavas ("comidas")
   Técnica: el div padre tiene overflow:visible y position:relative.
   4 spans absolutos con border-radius:50%, background blanco y
   border verde, colocados exactamente en las 4 esquinas externas
   del borde del recuadro. El tamaño del círculo (20px) determina
   cuánto "muerde" la esquina.
══════════════════════════════════════════════════════════════ */
.bb-box {
  position: relative;
  border: 2px solid var(--verde-bb);
  border-radius: 3px;          /* sin radio — las esquinas son rectas para que el círculo las "muerda" */
  background: #ffffff;
  overflow: visible;
}

/* Los 4 círculos de esquina — mismos props, diferente posición */
.bb-c {
  display: block;
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;         /* igual que el fondo del panel */
  border: 2px solid var(--verde-bb);
  z-index: 3;
}
.bb-c.tl { top:  -9px; left:  -9px; }
.bb-c.tr { top:  -9px; right: -9px; }
.bb-c.bl { bottom: -9px; left:  -9px; }
.bb-c.br { bottom: -9px; right: -9px; }

/* Banner de título verde dentro del cuadro */
.bb-tag {
  display: block;
  background: var(--verde-bb);
  color: #ffffff;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  text-align: center;
  padding: 7px 14px;
  position: relative;
  z-index: 1;
}

/* Texto verde oscuro sobre blanco */
.bb-text {
  font-size: 13px;
  color: var(--verde-bb2);
  line-height: 1.65;
  text-align: center;
  padding: 11px 18px 13px;
  font-family: Georgia, 'Times New Roman', serif;
}

.bb-bullet {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--verde-bb2);
  line-height: 1.55;
  padding: 0 18px;
  margin-bottom: 5px;
  font-family: Georgia, 'Times New Roman', serif;
}
.bb-bullet:first-of-type { padding-top: 9px; }
.bb-bullet:last-of-type  { padding-bottom: 11px; }
.bb-bullet::before {
  content: '•';
  font-size: 16px;
  color: var(--verde-bb);
  flex-shrink: 0;
  line-height: 1.35;
}

/* ── PANEL DERECHO ── */

/* ══════════════════════════════════════════════════════════════
   POST-IT — mensajes motivacionales (login + marcación)
══════════════════════════════════════════════════════════════ */
/* Capa global: cubre toda la pantalla pero nunca intercepta clics por sí
   misma (pointer-events:none) — solo cada post-it individual los reactiva.
   Así, aunque un post-it quede arrastrado sobre el formulario o los botones
   de marcar, mientras ese contenido tenga mayor z-index sigue siendo
   clicable con normalidad. */
#postit-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 15;
}
.postit {
  position: fixed;
  width: 220px;
  background: linear-gradient(160deg, #FFF3B0, #FCE38A);
  color: #4a3f14;
  padding: 20px 18px 18px;
  border-radius: 2px;
  box-shadow: 4px 6px 14px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.5) inset;
  font-family: 'Inter', sans-serif;
  transition: box-shadow .15s ease;
  pointer-events: auto;
  cursor: grab;
  user-select: none;
}
.postit.arrastrando {
  cursor: grabbing;
  box-shadow: 6px 10px 22px rgba(0,0,0,0.5), 0 1px 0 rgba(255,255,255,0.5) inset;
  transition: none;
}
.postit-pin {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a8a, #c62828);
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  pointer-events: none;
}
.postit-text {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: none;
}


/* ==============================================================
   TITULOS EN SERIF DISPLAY - Playfair Display (auto-alojada).
   El texto corrido serif institucional (vision/mision/valores)
   se mantiene en Georgia por legibilidad a tamano pequeno.
   ============================================================== */
h1, h2, h3, h4,
.login-form-body h2,
.bb-banner-label,
.bb-tag {
  font-family: var(--serif);
}

/* ==============================================================
   FONDO DE FACHADA EN EL LOGIN — FIJO, sin importar el tema.
   La foto de la botica matriz con un velo verde; la tarjeta del
   login flota encima. Es el fondo estándar de TODOS los logins.
   Se aplica al login principal (#page-login) y, vía la clase
   reutilizable .login-fachada, a cualquier otro login (p.ej. móvil).
   ============================================================== */
#page-login,
.login-fachada {
  background:
    linear-gradient(rgba(14,59,39,.72), rgba(14,59,39,.86)),
    url('../fachada.jpg') center / cover no-repeat !important;
}


/* ==============================================================
   MARCA VERDE DE BOTICA - FIJA EN EL LOGIN (cualquier tema).
   Los banners VISION/MISION/CONDICIONES/VALORES, el rotulo
   CONTROL DE ASISTENCIA y los botones (Identificarme por rostro /
   Ingresar) usan siempre el verde de marca, sin teñirse con el tema.
   Scopeado al login: #page-login (principal) y .login-fachada (movil).
   ============================================================== */
#page-login .bb-banner-svg path            { fill: var(--verde-botica); }
#page-login .login-section-list li::before { color: var(--verde-botica); }
#page-login .login-form-banner             { background: var(--verde-botica); }
#page-login .btn-primary,
.login-fachada .btn-primary                { background: var(--verde-botica); }

