/* =========================================================
   Estilos del LOGIN (acceder.xhtml) - aislados con prefijo lgn-
   Diseño moderno: tarjeta glass + gradientes, sin tablas.
   ========================================================= */

:root {
  --lgn-bg-1: #0b1c3d;
  --lgn-bg-2: #0e7c8a;
  --lgn-primary: #1180e0;
  --lgn-primary-2: #0a64b8;
  --lgn-success: #16a34a;
  --lgn-success-2: #15803d;
  --lgn-text: #0f172a;
  --lgn-muted: #64748b;
  --lgn-border: rgba(15, 23, 42, 0.12);
  --lgn-card: rgba(255, 255, 255, 0.92);
  --lgn-shadow: 0 18px 50px -10px rgba(2, 16, 41, 0.45),
                0 8px 18px -6px rgba(2, 16, 41, 0.25);
}

/* Reset puntual para esta vista */
html, body { height: 100%; }
body.lgn-body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto,
               Helvetica, Arial, sans-serif;
  color: var(--lgn-text);
  background: linear-gradient(135deg, var(--lgn-bg-1) 0%, var(--lgn-bg-2) 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fondo con imagen + capa de degradado oscurecida (mejor LCP) */
.lgn-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(135deg, rgba(11, 28, 61, 0.78) 0%, rgba(14, 124, 138, 0.55) 100%),
    var(--lgn-bg-image, none);
  background-size: cover;
  background-position: center;
  z-index: 0;
}
.lgn-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(1000px 600px at 80% -10%, rgba(255,255,255,0.15), transparent 60%),
              radial-gradient(800px 500px at -10% 110%, rgba(255,255,255,0.10), transparent 60%);
  pointer-events: none;
}

/* Cabecera superior compacta */
.lgn-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 10;
}
.lgn-header-title {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* Tarjeta central */
.lgn-shell {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 16px 32px;
  box-sizing: border-box;
}

.lgn-card {
  width: 100%;
  max-width: 400px;
  background: var(--lgn-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  padding: 36px 32px 18px;
  box-shadow: var(--lgn-shadow);
  animation: lgn-fade 280ms ease-out both;
}

@keyframes lgn-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Logo + título */
.lgn-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.lgn-logo {
  width: 220px;
  max-width: 100%;
  height: auto;
  display: block;
}
.lgn-subtitle {
  font-size: 12.5px;
  color: var(--lgn-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Campos con icono (flex, robusto) */
.lgn-field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  margin-bottom: 18px;
  background: #fff;
  border: 1px solid var(--lgn-border);
  border-radius: 10px;
  box-sizing: border-box;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.lgn-field:last-of-type {
  margin-bottom: 0;
}
.lgn-field:focus-within {
  border-color: var(--lgn-primary);
  box-shadow: 0 0 0 3px rgba(17, 128, 224, 0.18);
}
.lgn-field-icon {
  flex: 0 0 auto;
  width: 18px;
  font-size: 18px;
  line-height: 1;
  color: var(--lgn-muted);
  pointer-events: none;
}
.lgn-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  font-size: 15px;
  color: var(--lgn-text);
  background: transparent;
  border: none;
  outline: none;
  box-sizing: border-box;
}
.lgn-input::placeholder { color: #94a3b8; }

/* Botones */
.lgn-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 22px;
}
.lgn-btn {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 120ms ease, box-shadow 160ms ease,
              background 160ms ease, filter 160ms ease;
  text-decoration: none;
}
.lgn-btn:active { transform: translateY(1px); }

.lgn-btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #2196f3 0%, var(--lgn-primary-2) 100%);
  box-shadow: 0 6px 14px -4px rgba(10, 100, 184, 0.55);
}
.lgn-btn-primary:hover { filter: brightness(1.05); }

.lgn-btn-outline {
  color: var(--lgn-success-2);
  background: rgba(22, 163, 74, 0.08);
  border: 1.5px solid rgba(22, 163, 74, 0.55);
}
.lgn-btn-outline:hover {
  background: rgba(22, 163, 74, 0.14);
  border-color: var(--lgn-success);
}

/* Pie de tarjeta: enlaces utilitarios */
.lgn-links {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px dashed var(--lgn-border);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.lgn-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 6px;
  color: var(--lgn-text);
  text-decoration: none;
  font-size: 11.5px;
  line-height: 1.35;
  text-align: center;
  border-radius: 10px;
  transition: background 140ms ease, color 140ms ease;
}
.lgn-link i {
  font-size: 22px;
  line-height: 1;
  color: var(--lgn-primary);
  transition: transform 160ms ease;
}
.lgn-link:hover {
  background: rgba(17, 128, 224, 0.08);
  color: var(--lgn-primary-2);
}
.lgn-link:hover i { transform: translateY(-2px); }

/* Mensaje de error (popup) */
.lgn-error {
  position: fixed;
  z-index: 20;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(380px, calc(100% - 32px));
  background: #fff;
  border: 1px solid var(--lgn-border);
  border-radius: 14px;
  padding: 18px 20px 16px;
  box-shadow: var(--lgn-shadow);
}
.lgn-error-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  color: #b91c1c;
  margin-bottom: 8px;
}
.lgn-error-msg {
  color: #991b1b;
  font-size: 14.5px;
  text-align: center;
  margin: 6px 0 14px;
  word-break: break-word;
}
.lgn-error .lgn-close {
  background: transparent;
  border: none;
  color: var(--lgn-muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lgn-error .lgn-close:hover { background: rgba(0, 0, 0, 0.06); color: var(--lgn-text); }

/* =========================================================
   Selección de sesión (selecioneSesion.xhtml)
   ========================================================= */
.lgn-card-wide { max-width: 480px; }

.lgn-section-title {
  margin: 0 0 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lgn-muted);
}

/* Datatable como lista de tarjetas */
.lgn-sessions { background: transparent !important; border: none !important; }
.lgn-sessions .ui-datatable-tablewrapper { overflow: visible !important; }
.lgn-sessions table { width: 100% !important; border-collapse: separate !important; border-spacing: 0 !important; }

/* Filtro */
.lgn-sessions thead th {
  background: transparent !important;
  border: none !important;
  padding: 0 0 14px !important;
}
.lgn-sessions thead .ui-column-filter {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  font-size: 14px;
  background: #fff;
  color: var(--lgn-text);
  border: 1px solid var(--lgn-border);
  border-radius: 10px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.lgn-sessions thead .ui-column-filter:focus {
  border-color: var(--lgn-primary);
  box-shadow: 0 0 0 3px rgba(17, 128, 224, 0.18);
}

/* Filas como tarjetas */
.lgn-sessions tbody tr,
.lgn-sessions tbody tr.ui-datatable-even,
.lgn-sessions tbody tr.ui-datatable-odd {
  background: transparent !important;
  border: none !important;
  outline: none !important;
}
.lgn-sessions tbody td {
  padding: 5px 0 !important;
  border: none !important;
  background: transparent !important;
}

.lgn-session-card {
  display: flex !important;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--lgn-border);
  border-radius: 12px;
  text-decoration: none !important;
  color: var(--lgn-text) !important;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
  box-sizing: border-box;
}
.lgn-session-card:hover {
  border-color: var(--lgn-primary);
  box-shadow: 0 8px 18px -8px rgba(17, 128, 224, 0.45);
  transform: translateY(-1px);
}
.lgn-session-card:active { transform: translateY(0); }

.lgn-session-card-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(17, 128, 224, 0.12), rgba(14, 124, 138, 0.12));
  color: var(--lgn-primary);
  font-size: 20px;
}

.lgn-session-card-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}
.lgn-session-card-ruc {
  font-size: 12px;
  color: var(--lgn-muted);
  letter-spacing: 0.04em;
}
.lgn-session-card-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--lgn-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lgn-session-card-descri {
  font-size: 12px;
  color: var(--lgn-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lgn-session-card-arrow {
  flex: 0 0 auto;
  font-size: 14px;
  color: var(--lgn-muted);
}
.lgn-session-card:hover .lgn-session-card-arrow { color: var(--lgn-primary); }

/* Paginador */
.lgn-sessions .ui-paginator {
  background: transparent !important;
  border: none !important;
  padding: 14px 0 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.lgn-sessions .ui-paginator .ui-paginator-page,
.lgn-sessions .ui-paginator .ui-paginator-first,
.lgn-sessions .ui-paginator .ui-paginator-prev,
.lgn-sessions .ui-paginator .ui-paginator-next,
.lgn-sessions .ui-paginator .ui-paginator-last {
  min-width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--lgn-muted);
  text-decoration: none;
}
.lgn-sessions .ui-paginator .ui-state-active {
  background: var(--lgn-primary) !important;
  color: #fff !important;
  border-color: var(--lgn-primary) !important;
}

/* Mensaje vacío */
.lgn-sessions .ui-datatable-empty-message {
  padding: 24px 8px !important;
  color: var(--lgn-muted);
  text-align: center;
  background: transparent !important;
}

/* Loader (spinner CSS, sin GIF) */
.lgn-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 28px;
}
.lgn-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(17, 128, 224, 0.18);
  border-top-color: var(--lgn-primary);
  animation: lgn-spin 800ms linear infinite;
}
@keyframes lgn-spin { to { transform: rotate(360deg); } }
.lgn-loader-text {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--lgn-muted);
}

/* Responsivo */
@media (max-width: 420px) {
  .lgn-card { padding: 26px 20px 14px; border-radius: 16px; }
  .lgn-logo { width: 180px; }
  .lgn-input, .lgn-btn { height: 42px; }
  .lgn-logo-wrap { margin-bottom: 22px; }
  .lgn-actions { margin-top: 18px; }
  .lgn-links { margin-top: 22px; padding-top: 16px; }
  .lgn-session-card { padding: 10px 12px; gap: 10px; }
  .lgn-session-card-icon { width: 36px; height: 36px; font-size: 18px; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .lgn-card { animation: none; }
  .lgn-link i, .lgn-btn { transition: none; }
  .lgn-spinner { animation-duration: 1600ms; }
}
