/*
 * SOS AUDIT — estilos base del frontend.
 *
 * Identidad de marca tomada del logo real (assets/img/logo.jpeg): navy +
 * azul vívido + gris pizarra. Layout del Dashboard (sidebar oscuro
 * agrupado, KPIs, línea+donut, tabla/impacto/alertas) tomado como
 * referencia visual de una pantalla de ejemplo (ver docs/08-dashboard.md:
 * "toma como referencia visual las pantallas proporcionadas de SOS
 * Audit, sin copiar marca, identidad ni contenido") — nombre, textos y
 * datos son los nuestros, ficticios.
 *
 * Nota de nombre: el logo dice "SOS AUDIT"; la documentación del
 * proyecto (CLAUDE.md, docs/) usa "BINTE AUDIT". Pendiente de
 * confirmación (ver frontend/README.md).
 *
 * Un solo tema (claro para el contenido, sidebar oscuro por diseño) —
 * decisión deliberada para esta fase, no modo oscuro completo de la app.
 */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --border: #e2e6f0;
  --border-strong: #d3d9e8;

  --navy: #0e1e42;
  --navy-2: #16294f;
  --navy-3: #1c3363;
  --blue: #2454e5;
  --blue-light: #5c86f2;
  --slate: #5a6472;

  --text-primary: #101828;
  --text-secondary: #5a6472;
  --text-muted: #8a93a6;

  --good: #12946f;
  --good-soft: #e6f6f0;
  --warning: #c8860d;
  --warning-soft: #fbf1e0;
  --serious: #e08a3d;
  --serious-soft: #fcf0e3;
  --critical: #d23c3c;
  --critical-soft: #fbe9e9;
  --violet: #7c3aed;
  --violet-soft: #f0e9fd;
  --pink: #d6479e;
  --pink-soft: #fbe8f3;
  --muted-ring: #b7bfd1;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 2px 4px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(16, 24, 40, 0.06);

  --sidebar-width: 17rem;
  --sidebar-width-collapsed: 4.75rem;
}

html,
body {
  height: 100%;
}

/* Tailwind (CDN) no incluye esta regla por defecto; es necesaria para
   que x-cloak oculte los elementos antes de que Alpine arranque. */
[x-cloak] {
  display: none !important;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-variant-numeric: proportional-nums;
}

::selection {
  background: rgba(36, 84, 229, 0.16);
  color: var(--blue);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.thin-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.thin-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.thin-scrollbar::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
}

.panel {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.skeleton-block {
  background-color: var(--surface-2);
  border-radius: 0.5rem;
  animation: skeleton-pulse 1.4s ease-in-out infinite;
}
@keyframes skeleton-pulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.95;
  }
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2rem;
}
.status-badge--critical {
  background-color: var(--critical-soft);
  color: var(--critical);
}
.status-badge--serious {
  background-color: var(--serious-soft);
  color: var(--serious);
}
.status-badge--warning {
  background-color: var(--warning-soft);
  color: var(--warning);
}
.status-badge--good {
  background-color: var(--good-soft);
  color: var(--good);
}

.truncate-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tono decorativo reutilizado por íconos de KPI, líneas de tendencia,
   puntos de leyenda y alertas. Nunca se usa para "estado" real (eso es
   .status-badge / --good/--warning/--critical) salvo cuando el tono
   coincide con un estado genuino (ej. warning). */
.tone-blue {
  color: var(--blue);
  background: #e8edfd;
}
.tone-good {
  color: var(--good);
  background: var(--good-soft);
}
.tone-warning {
  color: var(--warning);
  background: var(--warning-soft);
}
.tone-critical {
  color: var(--critical);
  background: var(--critical-soft);
}
.tone-violet {
  color: var(--violet);
  background: var(--violet-soft);
}
.tone-pink {
  color: var(--pink);
  background: var(--pink-soft);
}

/* ============================================================
   Sidebar (oscuro, agrupado, colapsable)
   ============================================================ */
.rail {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--navy) 0%, #0a1730 100%);
  color: #cbd3e6;
  transition: width 0.2s ease;
}
.rail.collapsed {
  width: var(--sidebar-width-collapsed);
}

.brand-mark .n1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #ffffff;
}
.brand-mark .n2 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--blue-light);
}

.rail-shield {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rail-group-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #6d7797;
  text-transform: uppercase;
  padding: 0.9rem 0.75rem 0.4rem;
}
.rail.collapsed .rail-group-label,
.rail.collapsed .rail-label-text,
.rail.collapsed .brand-tagline,
.rail.collapsed .company-mini .txt {
  display: none;
}

.rail-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  margin: 0 0.6rem 0.15rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #b7c0da;
  position: relative;
}
.rail-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.9;
}
.rail-item:not(.locked):hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.rail-item.active {
  color: #fff;
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue-light) 140%);
  font-weight: 700;
}
.rail-item.locked {
  color: #5c6684;
  cursor: not-allowed;
}
.rail-item.locked svg {
  opacity: 0.55;
}
.rail-item .lock {
  width: 13px;
  height: 13px;
  opacity: 0.6;
  flex-shrink: 0;
}

.rail-collapse-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #8b93b0;
}
.rail-collapse-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.rail-collapse-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}
.rail.collapsed .rail-collapse-btn svg {
  transform: rotate(180deg);
}

.company-mini {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}
.company-mini:hover {
  background: rgba(255, 255, 255, 0.1);
}
.company-mini .ic {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  flex-shrink: 0;
}
.company-mini .txt {
  min-width: 0;
  text-align: left;
  flex: 1;
}
.company-mini .name {
  font-size: 0.76rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.company-mini .rfc {
  font-size: 0.66rem;
  color: #8b93b0;
}

/* ============================================================
   Header
   ============================================================ */
.header-logo {
  height: 30px;
  width: auto;
  display: block;
  object-fit: contain;
}
.avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}
.header-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  color: var(--text-secondary);
}
.header-icon-btn:hover {
  background: var(--surface-2);
}
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--critical);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
}
.dropdown-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

/* ============================================================
   KPIs
   ============================================================ */
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}
.kpi-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-icon svg {
  width: 22px;
  height: 22px;
}
.kpi .label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.kpi .value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 0.15rem;
  letter-spacing: -0.01em;
}
.kpi .delta {
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 0.3rem;
}
.kpi .delta.good {
  color: var(--good);
}
.kpi .delta.bad {
  color: var(--critical);
}

/* ============================================================
   Donut
   ============================================================ */
.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0;
}
.donut-legend-item .sw {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   Tabla de proveedores
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.data-table th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
/* Más específico que ".data-table th" a propósito: para que la clase
   "text-center" de Tailwind pueda centrar un encabezado en vez de
   quedarse siempre en text-align:left. */
.data-table th.text-center {
  text-align: center;
}
.data-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.data-table tr:last-child td {
  border-bottom: none;
}
.rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 700;
}

/* ============================================================
   Impacto económico (lista de stats)
   ============================================================ */
.stat-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
}
.stat-row + .stat-row {
  border-top: 1px solid var(--border);
}
.stat-row .ic {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-row .ic svg {
  width: 18px;
  height: 18px;
}
.stat-row .label {
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.stat-row .value {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* ============================================================
   Alertas
   ============================================================ */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.7rem 0;
}
.alert-item + .alert-item {
  border-top: 1px solid var(--border);
}
.alert-item .ic {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.alert-item .ic svg {
  width: 16px;
  height: 16px;
}
.alert-item .title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}
.alert-item .subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.alert-item .time {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ============================================================
   Resumen ejecutivo
   ============================================================ */
.summary {
  border-left: 3px solid var(--blue);
  padding: 0.3rem 0 0.3rem 1.15rem;
}
.summary p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 70ch;
}
.summary strong {
  color: var(--text-primary);
}

/* ============================================================
   Selector de rango de fechas (cosmético — ver README)
   ============================================================ */
.date-range-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}
.date-range-btn:hover {
  border-color: var(--border-strong);
}

/* ============================================================
   Auditoría de Almacenes: badge de clasificación (neutral — es una
   categoría nominal, no un estado, así que no lleva color semántico)
   y chips de filtro.
   ============================================================ */
.classification-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
}
.classification-badge svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.filter-chip:hover {
  border-color: var(--border-strong);
}
.filter-chip.active {
  border-color: var(--blue);
  background: #eef2fd;
  color: var(--blue);
}
.filter-chip .count {
  font-size: 0.68rem;
  color: var(--text-muted);
}
.filter-chip.active .count {
  color: var(--blue);
}

/* ============================================================
   Selección de empresa
   ============================================================ */
/* auto-fit en vez de columnas fijas (sm:grid-cols-2 de Tailwind): con
   una sola empresa, columnas fijas dejarían la tarjeta ocupando sólo la
   primera columna (angosta) en vez de estirarse a lo ancho. */
.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.company-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
}
.company-eyebrow svg {
  width: 13px;
  height: 13px;
}

.company-card {
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.company-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.company-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--navy), var(--blue));
}
.company-card.offline .company-icon {
  background: linear-gradient(135deg, #8a93a6, #b7bfd1);
}

/* ============================================================
   Login: layout de dos paneles (marca + formulario).
   ============================================================ */
.login-shell {
  display: flex;
  min-height: 100vh;
}

.login-brand-panel {
  position: relative;
  overflow: hidden;
  width: 45%;
  min-width: 380px;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #cbd3e6;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem 3.25rem;
}
.login-brand-panel::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -15%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(92, 134, 242, 0.28), transparent 70%);
  pointer-events: none;
}
.login-brand-panel > * {
  position: relative;
  z-index: 1;
}

.login-brand-mark {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.login-brand-mark .shield {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.login-brand-mark .wordmark {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.login-brand-mark .wordmark .n1 {
  color: #fff;
}
.login-brand-mark .wordmark .n2 {
  color: var(--blue-light);
}
.login-brand-mark .tagline {
  margin-top: 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7c86a6;
}

.login-brand-copy {
  max-width: 26rem;
}
.login-brand-copy h1 {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #fff;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}
.login-brand-copy p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #aab2cc;
  margin: 0 0 1.75rem;
}

.login-feature-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.login-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.85rem;
  color: #c3cae2;
  line-height: 1.5;
}
.login-feature-list .tick {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.05rem;
  background: rgba(92, 134, 242, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-feature-list svg {
  width: 13px;
  height: 13px;
  color: var(--blue-light);
}

.login-brand-footer {
  font-size: 0.72rem;
  color: #6d7797;
}

.login-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}
.login-form-wrap {
  width: 100%;
  max-width: 23rem;
}

.login-mobile-brand {
  display: none;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.login-mobile-footer {
  display: none;
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}

@media (max-width: 860px) {
  .login-brand-panel {
    display: none;
  }
  .login-mobile-brand {
    display: flex;
  }
  .login-mobile-footer {
    display: block;
  }
}

/* ============================================================
   Gate de licencia (pre-login): verificación de clave antes de
   mostrar el formulario de login. Tratamiento deliberadamente
   distinto del login (fondo navy + tarjeta elevada) — es una
   pantalla de "activación", conceptualmente distinta del login en
   sí. Ver frontend/README.md.
   ============================================================ */
.gate-stage {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  overflow: hidden;
  background:
    radial-gradient(60% 55% at 50% 8%, rgba(92, 134, 242, 0.35), transparent 70%),
    linear-gradient(165deg, #0a1730 0%, var(--navy) 46%, var(--navy-3) 100%);
}
.gate-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(80% 70% at 50% 30%, #000 40%, transparent 90%);
  mask-image: radial-gradient(80% 70% at 50% 30%, #000 40%, transparent 90%);
  pointer-events: none;
}
.gate-watermark {
  position: absolute;
  top: -6%;
  right: -8%;
  width: 46vw;
  max-width: 560px;
  opacity: 0.05;
  pointer-events: none;
}
.gate-watermark svg {
  width: 100%;
  height: 100%;
  display: block;
}

.gate-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(6, 12, 32, 0.45), 0 2px 6px rgba(6, 12, 32, 0.12);
  padding: 2.75rem 2.5rem 2.25rem;
  text-align: center;
}
.gate-logo {
  height: 4.25rem;
  width: auto;
  margin: 0 auto 1.35rem;
  display: block;
}
.gate-eyebrow {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 0.6rem;
}
.gate-card h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
  text-wrap: balance;
}
.gate-subtext {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 1.85rem;
}

.gate-field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 0.45rem;
}
.gate-input-wrap {
  position: relative;
}
.gate-input-wrap svg {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.15s ease;
}
.gate-input-wrap.has-error svg {
  color: var(--critical);
}
.gate-input {
  width: 100%;
  padding: 0.85rem 0.85rem 0.85rem 2.6rem;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  font-size: 1rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: 0.03em;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  background: #fbfcfe;
}
.gate-input::placeholder {
  color: #c2c8d6;
  letter-spacing: 0.03em;
}
.gate-input:focus {
  border-color: var(--blue);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(36, 84, 229, 0.14);
}
.gate-input.has-error {
  border-color: var(--critical);
  background: #fffaf9;
}

.gate-field-error {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--critical);
}
.gate-field-error svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.gate-btn {
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.85rem 1.1rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  box-shadow: 0 10px 22px rgba(36, 84, 229, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.gate-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(36, 84, 229, 0.34);
}
.gate-btn:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

.gate-helper {
  margin-top: 1.35rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.gate-icon-circle {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.1rem;
  background-color: var(--critical-soft);
}
.gate-icon-circle svg {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--critical);
}

.gate-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.gate-footer {
  position: relative;
  z-index: 1;
  margin-top: 1.35rem;
  text-align: center;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 420px) {
  .gate-card {
    padding: 2.25rem 1.5rem 1.85rem;
    border-radius: 18px;
  }
  .gate-logo {
    height: 3.5rem;
  }
  .gate-card h1 {
    font-size: 1.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rail,
  .rail-collapse-btn svg {
    transition: none !important;
  }
}
