/**
 * LUMIN — capa de acabado (sistema v3)
 * Tras lumin.css + lumin-console.css: ritmo, sombras suaves, sin ruido.
 */

:root {
  --lm-blur: 16px;
  --lm-ease: cubic-bezier(0.33, 1, 0.68, 1);
  --lm-t: 0.2s var(--lm-ease);
  --lm-ring: 0 0 0 3px rgba(var(--primary-rgb), 0.22);
}

html {
  scroll-behavior: smooth;
}

body {
  letter-spacing: -0.013em;
}

::selection {
  background: rgba(var(--primary-rgb), 0.2);
  color: inherit;
}

.auth-service-header {
  position: relative;
}

/* Topbar clara en todo el portal (incluye gestión electoral) */
.topbar {
  backdrop-filter: blur(var(--lm-blur));
  -webkit-backdrop-filter: blur(var(--lm-blur));
  background: rgba(255, 255, 255, 0.92);
}

.topbar__date {
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(var(--primary-rgb), 0.08);
  border: 1px solid rgba(var(--primary-rgb), 0.14);
  letter-spacing: 0.02em;
}

.icon-btn {
  border-radius: var(--radius-lg, 12px);
  transition: background-color var(--lm-t), color var(--lm-t), box-shadow var(--lm-t);
}

.icon-btn:hover {
  background: rgba(var(--primary-rgb), 0.09);
  color: var(--primary);
}

.topbar__brand {
  transition: opacity var(--lm-t);
}

.topbar__brand:hover {
  opacity: 0.9;
}

.app-shell {
  min-height: 100vh;
}

.page-app .sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: 6px 0 28px rgba(15, 23, 42, 0.035);
}

.sidebar__link {
  transition: background-color var(--lm-t), color var(--lm-t), border-color var(--lm-t);
  border-radius: var(--radius-lg, 12px);
  border: 1px solid transparent;
  font-weight: 500;
}

.sidebar__link:hover {
  background: rgba(var(--primary-rgb), 0.07);
  border-color: rgba(var(--primary-rgb), 0.12);
}

.sidebar__link.is-active {
  background: rgba(var(--primary-rgb), 0.12);
  border-color: rgba(var(--primary-rgb), 0.22);
  color: var(--primary);
  font-weight: 700;
}

.app-main {
  background: transparent;
}

/* Hub */
.portal-page__head {
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.12);
  padding-bottom: 1.2rem;
}

.portal-sub__crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  padding: 0.4rem 0 0.2rem;
}

.portal-sub__title {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  padding-left: 0;
  margin-left: 0;
  border-left: none;
}

.portal-sub__lede {
  font-size: 0.97rem;
  line-height: 1.6;
  max-width: 40rem;
}

.portal-tile {
  border-radius: var(--radius-xl, 14px);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.04));
}

.portal-tile:hover {
  border-color: rgba(var(--primary-rgb), 0.22);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(15, 23, 42, 0.06));
}

.portal-card {
  border-radius: var(--radius-xl, 16px);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  transition: box-shadow var(--lm-t), border-color var(--lm-t), transform var(--lm-t);
}

.portal-card:hover {
  border-color: rgba(var(--primary-rgb), 0.18);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(15, 23, 42, 0.06));
}

.portal-kv {
  border-radius: var(--radius-xl, 14px);
  background: var(--surface);
  border: 1px solid var(--border);
}

.portal-sub__callout {
  border-radius: var(--radius-xl, 16px);
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  background: rgba(var(--primary-rgb), 0.05);
}

/* Portada */
.page-landing .landing-splash {
  padding-bottom: 3rem;
}

.landing-card,
.card-elevated {
  border-radius: var(--radius-auth-card, 24px);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-hover);
  transition: box-shadow var(--lm-t), transform var(--lm-t);
}

.landing-card:hover {
  box-shadow: var(--shadow-md, 0 4px 12px rgba(15, 23, 42, 0.08));
}

.landing-foot,
.landing-realm-foot {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Formularios — tema claro global */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
select,
textarea {
  border-radius: var(--radius-lg, 12px);
  transition: border-color var(--lm-t), box-shadow var(--lm-t), background-color var(--lm-t);
}

input:not([type="checkbox"]):not([type="radio"]):focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--lm-ring);
}

input[type="file"] {
  border-radius: var(--radius-lg, 12px);
  padding: 0.5rem;
  border: 1px dashed rgba(var(--primary-rgb), 0.35);
  background: rgba(var(--primary-rgb), 0.04);
}

/* Botones */
.btn,
button:not(.visually-hidden),
input[type="submit"],
input[type="button"] {
  border-radius: var(--radius-lg, 12px);
  transition:
    background-color var(--lm-t),
    color var(--lm-t),
    border-color var(--lm-t),
    box-shadow var(--lm-t),
    transform 0.12s ease;
}

.btn:active,
button:not(.visually-hidden):active,
input[type="submit"]:active {
  transform: translateY(1px);
}

.btn-primary,
.btn-gradient,
input[type="submit"].btn-primary {
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.04));
}

.btn-primary:hover,
.btn-gradient:hover,
input[type="submit"].btn-primary:hover {
  box-shadow: var(--shadow-md, 0 4px 12px rgba(15, 23, 42, 0.06));
}

/* Tablas */
table {
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
  box-shadow: var(--shadow);
}

thead th {
  font-weight: 800;
  letter-spacing: 0.05em;
  font-size: 0.7rem;
}

tbody tr:hover {
  background-color: rgba(var(--primary-rgb), 0.04);
}

.form-flash--ok,
.form-flash--error,
.form-flash--info {
  border-radius: var(--radius-lg, 12px);
  border-left-width: 4px;
}

/* Dashboard */
.page-dashboard-pro .cpanel--profile {
  border-radius: var(--radius-xl, 18px);
}

.page-dashboard-pro .cp-card {
  border-radius: var(--radius-xl, 16px);
}

.cred-id,
.cred-back {
  border-radius: var(--radius-xl, 18px);
}

/* Gestión electoral (claro): sombras suaves */
.page-electoral-pro .portal-tab-panel {
  border-radius: var(--radius-xl, 16px);
}

.page-electoral-pro .portal-card:hover {
  box-shadow: var(--shadow-hover);
}

.page-electoral-pro .btn-gradient {
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.04));
}

.page-login-pro .login-card.card-elevated {
  border-radius: var(--radius-auth-card, 22px);
}

main a:not(.btn):not(.topbar__brand):not(.portal-tile) {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

code {
  border-radius: var(--radius-sm, 8px);
  font-family: ui-monospace, "Cascadia Code", monospace;
}

::-webkit-scrollbar-thumb {
  background: rgba(var(--primary-rgb), 0.28);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--primary-rgb), 0.45);
  background-clip: padding-box;
}

/* =========================================================
   LUMIN v4 — refresco integral de toda la interfaz (2026)
   Esta capa se carga al final y refina (sin reescribir) las
   piezas existentes: paleta, tipografía, tarjetas, botones,
   formularios, cabeceras, tabs y tablas.
   ========================================================= */

:root {
  --lm4-bg-base: #f4f6fb;
  --lm4-bg-soft: #eef2f9;
  --lm4-surface: #ffffff;
  --lm4-surface-2: #f8fafd;
  --lm4-ink: #0b1a30;
  --lm4-ink-soft: #344155;
  --lm4-muted: #5a6878;
  --lm4-line: #e1e7ef;
  --lm4-line-soft: #eef1f6;
  --lm4-primary: #0b3b78;
  --lm4-primary-strong: #062a59;
  --lm4-primary-soft: #e8eef9;
  --lm4-primary-rgb: 11, 59, 120;
  --lm4-accent: #b88638;
  --lm4-accent-warm: #f3c468;
  --lm4-success: #16a34a;
  --lm4-success-bg: #e8f7ee;
  --lm4-warn: #b45309;
  --lm4-warn-bg: #fdf2dc;
  --lm4-danger: #b91c1c;
  --lm4-danger-bg: #fbe9e7;
  --lm4-radius-xs: 6px;
  --lm4-radius-sm: 10px;
  --lm4-radius-md: 14px;
  --lm4-radius-lg: 18px;
  --lm4-radius-xl: 24px;
  --lm4-shadow-soft: 0 1px 2px rgba(11, 26, 48, 0.05), 0 4px 18px rgba(11, 26, 48, 0.05);
  --lm4-shadow-card: 0 1px 2px rgba(11, 26, 48, 0.06), 0 8px 28px rgba(11, 26, 48, 0.08);
  --lm4-shadow-hero: 0 18px 48px rgba(11, 26, 48, 0.18);
  --lm4-font-body: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system,
    "Helvetica Neue", Arial, sans-serif;
  --lm4-font-display: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman",
    serif;
  --lm4-font-mono: ui-monospace, "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
}

html,
body {
  background: var(--lm4-bg-base);
  color: var(--lm4-ink);
  font-family: var(--lm4-font-body);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 12% 8%, rgba(11, 59, 120, 0.06) 0%, rgba(11, 59, 120, 0) 40%),
    radial-gradient(circle at 92% 92%, rgba(184, 134, 56, 0.05) 0%, rgba(184, 134, 56, 0) 40%);
  pointer-events: none;
}

/* Tipografía global — títulos un poco más serios y respiración */
h1, h2, h3, h4 {
  letter-spacing: -0.012em;
  color: var(--lm4-ink);
}
.portal-page__title,
.portal-sub__title,
.cpanel__title,
.landing-heading,
.login-title {
  font-family: var(--lm4-font-display);
  font-weight: 700;
  letter-spacing: -0.018em;
}

/* Topbar reformulado */
.topbar {
  border-bottom: 1px solid var(--lm4-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 253, 0.94));
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
}
.topbar__date {
  background: var(--lm4-primary-soft);
  border-color: rgba(var(--lm4-primary-rgb), 0.18);
  color: var(--lm4-primary);
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Sidebar reformulado: más limpia */
.page-app .sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #f7fafd 100%);
  border-right: 1px solid var(--lm4-line);
  box-shadow: 4px 0 28px rgba(11, 26, 48, 0.04);
}
.sidebar__head {
  padding: 1rem 1.1rem 0.8rem;
  border-bottom: 1px solid var(--lm4-line-soft);
}
.sidebar__head-k {
  font-family: var(--lm4-font-display);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--lm4-primary);
}
.sidebar__head-t {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lm4-muted);
}
.sidebar__nav {
  padding: 0.6rem;
  gap: 0.2rem;
}
.sidebar__link {
  border-radius: 12px;
  font-size: 0.93rem;
  padding: 0.6rem 0.85rem;
  font-weight: 500;
  color: var(--lm4-ink-soft);
}
.sidebar__link .sidebar__ico {
  color: var(--lm4-primary);
  font-size: 1rem;
}
.sidebar__link.is-active {
  background: var(--lm4-primary-soft);
  color: var(--lm4-primary-strong);
  border-color: rgba(var(--lm4-primary-rgb), 0.22);
  box-shadow: inset 0 0 0 1px rgba(var(--lm4-primary-rgb), 0.18);
}

/* Cards y superficies */
.card-elevated,
.landing-card,
.login-card.card-elevated,
.portal-card,
.cp-card {
  background: var(--lm4-surface);
  border: 1px solid var(--lm4-line);
  border-radius: var(--lm4-radius-lg);
  box-shadow: var(--lm4-shadow-soft);
  transition: box-shadow 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}
.portal-card:hover,
.cp-card:hover {
  box-shadow: var(--lm4-shadow-card);
  border-color: rgba(var(--lm4-primary-rgb), 0.22);
  transform: translateY(-1px);
}

/* Botones — con peso y elegancia */
.btn,
button.btn,
input[type="submit"].btn {
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.7rem 1.15rem;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.1;
}
.btn-gradient,
.btn-primary {
  background: linear-gradient(180deg, #0b3b78 0%, #062a59 100%);
  border: 1px solid #062a59;
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 8px 18px rgba(11, 26, 48, 0.18);
}
.btn-gradient:hover,
.btn-primary:hover {
  background: linear-gradient(180deg, #0f4790 0%, #0b3b78 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 12px 24px rgba(11, 26, 48, 0.22);
  transform: translateY(-1px);
}
.btn-gradient:active,
.btn-primary:active {
  transform: translateY(0);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 4px 12px rgba(11, 26, 48, 0.18);
}
.btn-soft {
  background: var(--lm4-surface);
  border: 1px solid var(--lm4-line);
  color: var(--lm4-ink);
}
.btn-soft:hover {
  background: var(--lm4-primary-soft);
  border-color: rgba(var(--lm4-primary-rgb), 0.32);
  color: var(--lm4-primary-strong);
}

/* Formularios — campos con etiqueta flotante en altura cómoda */
.field {
  display: block;
  margin-bottom: 0.85rem;
}
.field__label {
  display: block;
  margin-bottom: 0.32rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--lm4-muted);
}
.input,
.input--auth {
  width: 100%;
  background: var(--lm4-surface);
  border: 1px solid var(--lm4-line);
  border-radius: 12px;
  padding: 0.66rem 0.85rem;
  font-size: 0.96rem;
  color: var(--lm4-ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
.input:focus,
.input--auth:focus,
.input:focus-visible,
.input--auth:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--lm4-primary);
  box-shadow: 0 0 0 4px rgba(var(--lm4-primary-rgb), 0.18);
}
.input::placeholder,
.input--auth::placeholder {
  color: #94a3b8;
}

textarea.input {
  min-height: 96px;
  font-family: var(--lm4-font-body);
  line-height: 1.5;
}

select.input,
select.input--auth {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--lm4-muted) 50%),
    linear-gradient(135deg, var(--lm4-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.2rem;
}

/* Banners */
.form-flash {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  font-size: 0.93rem;
  border-left: 4px solid var(--lm4-line);
  background: var(--lm4-surface);
  box-shadow: var(--lm4-shadow-soft);
}
.form-flash--ok {
  border-left-color: var(--lm4-success);
  background: var(--lm4-success-bg);
  color: #14532d;
}
.form-flash--error {
  border-left-color: var(--lm4-danger);
  background: var(--lm4-danger-bg);
  color: #7f1d1d;
}
.form-flash--info {
  border-left-color: var(--lm4-primary);
  background: var(--lm4-primary-soft);
  color: var(--lm4-primary-strong);
}

/* Hub portal */
.portal-page__head {
  border-bottom: 1px solid var(--lm4-line);
  padding: 1.4rem 0 1.2rem;
  margin-bottom: 1rem;
}
.portal-page__eyebrow {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lm4-accent);
}
.portal-page__title {
  margin: 0.25rem 0 0.55rem;
  font-size: clamp(1.7rem, 2.4vw, 2.2rem);
}
.portal-page__lede {
  max-width: 56rem;
  color: var(--lm4-ink-soft);
  font-size: 1rem;
  line-height: 1.6;
}

.portal-tile {
  background: var(--lm4-surface);
  border: 1px solid var(--lm4-line);
  border-radius: var(--lm4-radius-lg);
  padding: 1rem 1.1rem;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 0.5rem 0.85rem;
  align-items: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  text-decoration: none;
  color: inherit;
}
.portal-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--lm4-primary-rgb), 0.3);
  box-shadow: var(--lm4-shadow-card);
}
.portal-tile__ico {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lm4-primary-soft);
  color: var(--lm4-primary);
  flex-shrink: 0;
}
.portal-tile__ico-svg {
  width: 24px;
  height: 24px;
}
.portal-tile__k {
  font-family: var(--lm4-font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--lm4-ink);
  display: block;
}
.portal-tile__d {
  font-size: 0.83rem;
  color: var(--lm4-muted);
  line-height: 1.45;
  display: block;
  margin-top: 0.15rem;
}
.portal-tile__go {
  color: var(--lm4-primary);
}

/* Tabs uniformes */
.portal-tabs {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--lm4-line);
  margin: 0.4rem 0 1rem;
  padding: 0;
}
.portal-tabs__a {
  padding: 0.6rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--lm4-ink-soft);
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  text-decoration: none;
  border-radius: 8px 8px 0 0;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.portal-tabs__a:hover {
  background: var(--lm4-primary-soft);
  color: var(--lm4-primary-strong);
}
.portal-tabs__a.is-active {
  color: var(--lm4-primary-strong);
  border-bottom-color: var(--lm4-primary);
  background: linear-gradient(180deg, rgba(var(--lm4-primary-rgb), 0.05) 0%, transparent 100%);
}

.portal-tab-panel {
  background: var(--lm4-surface);
  border: 1px solid var(--lm4-line);
  border-radius: var(--lm4-radius-lg);
  box-shadow: var(--lm4-shadow-soft);
  padding: 1.4rem 1.5rem 1.6rem;
}
.portal-tab-panel__h {
  font-family: var(--lm4-font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 0.45rem;
  color: var(--lm4-ink);
}

/* Migas de pan */
.portal-sub__crumb {
  font-size: 0.83rem;
}
.portal-sub__crumb a {
  color: var(--lm4-primary);
  text-decoration: none;
}
.portal-sub__crumb a:hover {
  text-decoration: underline;
}
.portal-sub__crumb span {
  color: var(--lm4-muted);
}

/* Tablas — estilo tabular limpio */
table.table,
table.bocal-list,
.portal-tab-panel table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--lm4-surface);
  border: 1px solid var(--lm4-line);
  border-radius: 12px;
  overflow: hidden;
  font-size: 0.92rem;
  box-shadow: var(--lm4-shadow-soft);
}
.portal-tab-panel table th {
  background: var(--lm4-surface-2);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--lm4-muted);
  font-weight: 800;
  text-align: left;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--lm4-line);
}
.portal-tab-panel table td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--lm4-line-soft);
}
.portal-tab-panel table tr:last-child td {
  border-bottom: 0;
}
.portal-tab-panel table tbody tr:hover {
  background: var(--lm4-primary-soft);
}

/* portal-kv */
.portal-kv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  background: var(--lm4-surface-2);
  border: 1px solid var(--lm4-line);
  border-radius: 12px;
}
.portal-kv > div {
  background: var(--lm4-surface);
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--lm4-line-soft);
}
.portal-kv dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  color: var(--lm4-muted);
  margin-bottom: 0.15rem;
}
.portal-kv dd {
  margin: 0;
  color: var(--lm4-ink);
  font-weight: 600;
}

/* Landing */
.page-landing .landing-card {
  padding: 2.2rem 2rem 2.1rem;
  text-align: center;
  background:
    radial-gradient(circle at 50% -10%, rgba(11, 59, 120, 0.06) 0%, rgba(11, 59, 120, 0) 60%),
    var(--lm4-surface);
}
.landing-heading {
  font-family: var(--lm4-font-display);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
  margin: 0;
}
.landing-sub--realm {
  margin: 0.45rem 0 0.25rem;
  font-weight: 600;
  font-size: 0.96rem;
  color: var(--lm4-ink-soft);
}
.landing-tagline {
  margin: 0.2rem 0 1.4rem;
  color: var(--lm4-muted);
  font-size: 0.9rem;
}
.btn-landing {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  border-radius: 14px;
  letter-spacing: 0.02em;
}
.landing-foot,
.landing-realm-foot {
  margin-top: 1.2rem;
  font-size: 0.84rem;
}

/* Auth (login / registro / recuperar / restaurar) */
.auth-service-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 0% 0%, rgba(11, 59, 120, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(184, 134, 56, 0.06) 0%, transparent 50%),
    var(--lm4-bg-base);
}
.auth-service-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--lm4-line);
}
.auth-service-header__inner {
  padding: 0.85rem 1.4rem;
}
.auth-service-header__name {
  font-family: var(--lm4-font-display);
  font-weight: 800;
  color: var(--lm4-primary);
}
.auth-service-header__tagline {
  font-size: 0.86rem;
  color: var(--lm4-muted);
}
.auth-service-header__link {
  font-weight: 600;
  color: var(--lm4-primary);
  text-decoration: none;
}
.auth-service-header__link:hover {
  text-decoration: underline;
}
.login-card.card-elevated {
  padding: 2rem 2rem 1.7rem;
  border-radius: 22px;
  box-shadow: var(--lm4-shadow-card);
}
.login-card__head {
  text-align: center;
  border-bottom: 1px solid var(--lm4-line-soft);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}
.login-card__eyebrow {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lm4-accent);
}
.login-title {
  font-family: var(--lm4-font-display);
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  margin: 0.35rem 0 0.4rem;
}
.login-sub {
  margin: 0;
  color: var(--lm4-ink-soft);
  font-size: 0.92rem;
}
.btn--auth-submit {
  margin-top: 0.3rem;
  padding: 0.85rem 1.2rem;
  font-size: 0.98rem;
}
.login-foot {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.86rem;
  color: var(--lm4-muted);
  border-top: 1px dashed var(--lm4-line);
  padding-top: 0.85rem;
}
.login-foot__line a {
  color: var(--lm4-primary);
  font-weight: 600;
  text-decoration: none;
}
.login-foot__line a:hover {
  text-decoration: underline;
}
.login-foot__meta {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: var(--lm4-muted);
}
.auth-recover-panel {
  border-radius: 12px;
  padding: 0.75rem 0.95rem;
  margin: 0 0 0.85rem;
}
.auth-recover-panel--success {
  background: var(--lm4-success-bg);
  border: 1px solid #86efac;
  color: #14532d;
}
.auth-recover-panel--notice {
  background: var(--lm4-warn-bg);
  border: 1px solid #fcd34d;
  color: #78350f;
}
.auth-recover-panel__title {
  font-weight: 800;
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}
.auth-recover-panel__text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
}
.auth-recover-steps {
  margin: 0.55rem 0 0 1.1rem;
  padding: 0;
  font-size: 0.85rem;
}
.auth-recover-details {
  margin-top: 0.85rem;
  border-top: 1px dashed var(--lm4-line);
  padding-top: 0.5rem;
}
.auth-recover-details__sum {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--lm4-primary);
  list-style: none;
}
.auth-recover-details__sum::-webkit-details-marker {
  display: none;
}
.auth-recover-details__sum::before {
  content: "▾  ";
  font-size: 0.75rem;
}
.auth-recover-details[open] .auth-recover-details__sum::before {
  content: "▴  ";
}
.auth-recover-details__body {
  margin-top: 0.45rem;
  font-size: 0.85rem;
  color: var(--lm4-ink-soft);
}

/* Registro: alineación */
.page-register .register-card,
.page-register .register-form,
.page-register .register-page,
.page-register .register-pro__main {
  background: var(--lm4-surface);
  border-radius: var(--lm4-radius-lg);
  border: 1px solid var(--lm4-line);
  box-shadow: var(--lm4-shadow-soft);
}

/* Dashboard: hero */
.cpanel__masthead {
  background:
    linear-gradient(135deg, #0b3b78 0%, #062a59 100%);
  color: #f1f5fb;
  border-radius: var(--lm4-radius-lg);
  padding: 1.4rem 1.6rem;
  margin: 0 0 1rem;
  border: 1px solid #062a59;
  box-shadow: var(--lm4-shadow-hero);
}
.cpanel__title {
  color: #fff;
  font-family: var(--lm4-font-display);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  margin: 0.2rem 0 0.4rem;
}
.cpanel__lede {
  color: rgba(241, 245, 251, 0.86);
  margin: 0;
  max-width: 56rem;
}
.cpanel__eyebrow {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lm4-accent-warm);
  margin: 0;
}
.cpanel__masthead-dl {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
}
.cpanel__masthead-dl dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(241, 245, 251, 0.7);
}
.cpanel__masthead-dl dd {
  margin: 0;
  font-weight: 700;
  color: #fff;
}

/* Hero del despacho presidencial — compatibilidad con la capa nueva */
.rpres-hero {
  border-radius: var(--lm4-radius-lg);
  box-shadow: var(--lm4-shadow-hero);
}

/* Listas BOCAL */
.bocal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.bocal-list__item {
  background: var(--lm4-surface);
  border: 1px solid var(--lm4-line);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}
.bocal-list__item:hover {
  box-shadow: var(--lm4-shadow-soft);
  border-color: rgba(var(--lm4-primary-rgb), 0.22);
}
.bocal-list__id {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lm4-accent);
}
.bocal-list__t {
  margin: 0.18rem 0 0.18rem;
  font-family: var(--lm4-font-display);
  font-size: 1rem;
}
.bocal-list__t a {
  color: var(--lm4-primary-strong);
  text-decoration: none;
}
.bocal-list__t a:hover {
  text-decoration: underline;
}
.bocal-list__s {
  margin: 0;
  font-size: 0.86rem;
  color: var(--lm4-ink-soft);
}
.bocal-list__m {
  margin: 0.32rem 0 0;
  font-size: 0.78rem;
  color: var(--lm4-muted);
}

/* Publicador BOCAL */
.bocal-pub {
  background: var(--lm4-surface);
  border: 1px solid var(--lm4-line);
  border-radius: var(--lm4-radius-lg);
  padding: 1.3rem 1.5rem 1.5rem;
  box-shadow: var(--lm4-shadow-soft);
  margin: 0 0 1rem;
}
.bocal-pub__head {
  border-bottom: 1px solid var(--lm4-line-soft);
  padding-bottom: 0.8rem;
  margin-bottom: 1rem;
}
.bocal-pub__eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--lm4-accent);
}
.bocal-pub__title {
  font-family: var(--lm4-font-display);
  margin: 0.25rem 0 0.4rem;
  font-size: clamp(1.3rem, 2vw, 1.7rem);
}
.bocal-pub__lede {
  color: var(--lm4-ink-soft);
  margin: 0;
}
.bocal-pub__warn {
  background: var(--lm4-warn-bg);
  border: 1px solid #fcd34d;
  color: #78350f;
  border-radius: 12px;
  padding: 0.85rem 1rem;
}
.bocal-pub__row {
  display: grid;
  gap: 0.65rem 0.85rem;
  margin-bottom: 0.55rem;
}
.bocal-pub__row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bocal-pub__row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) {
  .bocal-pub__row--2,
  .bocal-pub__row--3 { grid-template-columns: 1fr; }
}
.bocal-pub__cuerpo {
  font-family: var(--lm4-font-mono);
  font-size: 0.92rem;
  line-height: 1.5;
  min-height: 240px;
}
.bocal-pub__actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

/* Botones de partidos / votación */
.elpro-vote-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 0.6rem 0;
}
.elpro-vote-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.4rem 0.7rem;
  align-items: center;
  padding: 0.65rem 0.8rem;
  background: var(--lm4-surface);
  border: 1px solid var(--lm4-line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.elpro-vote-card:hover {
  border-color: rgba(var(--lm4-primary-rgb), 0.32);
  box-shadow: var(--lm4-shadow-soft);
}
.elpro-vote-card input[type="radio"]:checked ~ * {
  /* visual cue handled below via :has fallback */
}
.elpro-vote-card:has(input:checked) {
  border-color: var(--lm4-primary);
  box-shadow: 0 0 0 4px rgba(var(--lm4-primary-rgb), 0.12);
}

/* Códigos / monoespaciado */
code {
  background: var(--lm4-surface-2);
  padding: 0.05em 0.45em;
  border-radius: 6px;
  font-family: var(--lm4-font-mono);
  font-size: 0.88em;
  color: var(--lm4-primary-strong);
}

/* Detalles colapsables */
details {
  border-radius: 10px;
  background: var(--lm4-surface-2);
  border: 1px solid var(--lm4-line-soft);
  padding: 0.5rem 0.8rem;
}
details > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--lm4-ink);
}

/* Subrayado de enlaces dentro de main */
main a:not(.btn):not(.topbar__brand):not(.portal-tile):not(.sidebar__link):not(.portal-tabs__a):not(.auth-service-header__link):not(.user-menu__btn) {
  color: var(--lm4-primary);
  text-decoration: underline;
  text-decoration-color: rgba(var(--lm4-primary-rgb), 0.3);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
}
main a:not(.btn):hover {
  text-decoration-color: var(--lm4-primary);
}

/* Avatares y badges del usermenu */
.user-menu__btn {
  border: 1px solid var(--lm4-line);
  background: var(--lm4-surface);
  border-radius: 999px;
  padding: 0.35rem 0.45rem 0.35rem 0.5rem;
}
.user-menu__btn:hover {
  border-color: rgba(var(--lm4-primary-rgb), 0.32);
  background: var(--lm4-primary-soft);
}
.user-menu__badge {
  background: linear-gradient(135deg, #0b3b78, #062a59);
  color: #fff;
  font-weight: 800;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.user-menu__label {
  font-weight: 700;
  color: var(--lm4-ink);
}

/* Etiquetas / chips genéricos */
.elpro-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--lm4-primary-soft);
  color: var(--lm4-primary-strong);
}

/* Mejor focus accesible */
:focus-visible {
  outline: 2px solid var(--lm4-primary);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Scrollbar refinado */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(var(--lm4-primary-rgb), 0.28);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--lm4-primary-rgb), 0.5);
  background-clip: padding-box;
}

/* Catastro: refresca la cabecera */
.page-app[data-page="catastro"] .portal-page__head,
.page-app[data-page="catastro"] .portal-sub {
  border-bottom-color: var(--lm4-line);
}

/* Print: limpia las pancartas y sombras */
@media print {
  .topbar,
  .sidebar,
  .auth-service-header,
  body::before {
    display: none !important;
  }
  .app-main {
    margin: 0 !important;
    padding: 0 !important;
  }
  .card-elevated,
  .login-card.card-elevated,
  .portal-card,
  .cp-card,
  .portal-tab-panel {
    box-shadow: none !important;
    border-color: #888 !important;
  }
}
