/* ==========================================================================
   LUMIN — Interfaz institucional (HTML/CSS/JS)
   Referencia visual: portales públicos europeos — neutros, contraste, claridad
   Tipografía: IBM Plex Sans (uso frecuente en administración digital)
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Outfit:wght@500;600;700&display=swap");

:root {
  /* Tema claro — acento azul #0056b3, titulares Outfit */
  --canvas: #e8eef7;
  --surface: #ffffff;
  --text: #0c111d;
  --text-muted: #475467;
  --border: #cdd8df;
  --border-light: #e2ebf0;
  --royal: #0056b3;
  --link: #0056b3;
  --link-hover: #004494;
  --primary: #0056b3;
  --primary-hover: #004494;
  --focus-ring: #fd0;
  --error: #d92d20;
  --success: #067647;
  --info-tint: #e8f4fc;
  --parchment: #f5f8fc;
  --parchment-deep: #eaf2f7;
  --ice-white: #ffffff;
  --frost: #e2ebf0;
  --celeste: #0056b3;
  --celeste-bright: rgba(0, 86, 179, 0.09);
  --sky: #e8eef7;
  --blue: #0056b3;
  --blue-deep: #004494;
  --glacier: #3b82c4;
  --navy: #0c111d;
  --violet: #5c6b7a;
  --green: #067647;
  --gold-bright: #0056b3;
  --bg-light: #f5f8fc;
  --bg-login-dark: #e8eef7;
  --bar-bg: #0b0c0c;
  --white: #ffffff;
  --code-bg: rgba(16, 24, 40, 0.06);
  --radius-sm: 6px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-auth-card: 20px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.07), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-hover: 0 12px 36px rgba(16, 24, 40, 0.11), 0 2px 8px rgba(16, 24, 40, 0.05);
  --shadow-elevated: 0 1px 2px rgba(16, 24, 40, 0.06);
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
  --topbar-h: 56px;
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 72px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-display: "Outfit", "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --rule-gold: 1px solid var(--border);
}

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

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background-color: var(--canvas);
  background-image: radial-gradient(ellipse 120% 70% at 50% -25%, rgba(0, 86, 179, 0.08), transparent 58%);
  line-height: 1.55;
  min-height: 100vh;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-decoration: underline; text-underline-offset: 0.12em; }
a:hover { color: var(--link-hover); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ---------- Componentes comunes ---------- */

.card-elevated {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.25;
  text-decoration: none;
  transition:
    background-color 0.18s var(--ease-out),
    box-shadow 0.18s var(--ease-out),
    border-color 0.18s var(--ease-out),
    color 0.18s var(--ease-out),
    transform 0.12s ease;
}
.btn:active { transform: translateY(1px); }

.btn-gradient {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 86, 179, 0.22);
  border: 1px solid var(--primary);
  text-decoration: none;
}
.btn-gradient:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 86, 179, 0.32);
  filter: none;
}

.btn-block { width: 100%; }

.btn-soft {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-light);
}
.btn-soft:hover {
  background: var(--parchment);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover {
  background: var(--info-tint);
  box-shadow: 0 1px 3px rgba(0, 86, 179, 0.14);
}

.btn-orange {
  background: #6f1e32;
  color: #ffffff;
  border: 1px solid #6f1e32;
}
.btn-orange:hover {
  background: #551526;
  border-color: #551526;
  box-shadow: 0 2px 10px rgba(111, 30, 50, 0.28);
}

.btn-violet {
  background: #243042;
  color: #ffffff;
  border: 1px solid #1a2433;
}
.btn-violet:hover {
  background: #1a2433;
  border-color: #121a26;
  box-shadow: 0 2px 10px rgba(26, 36, 51, 0.25);
}

.btn-sky {
  background: var(--info-tint);
  color: var(--link);
  border: 1px solid rgba(0, 86, 179, 0.2);
}
.btn-sky:hover {
  background: #dceefa;
  border-color: rgba(0, 86, 179, 0.3);
}

.btn-admin {
  background: var(--success);
  color: #ffffff;
  border: 1px solid var(--success);
}
.btn-admin:hover {
  filter: brightness(1.05);
  box-shadow: 0 2px 10px rgba(6, 118, 71, 0.28);
}

.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.field--flush { margin-bottom: 0.75rem; }
.field--compact { margin-bottom: 0.75rem; }
.field__label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.field__hint {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  margin: 0 0 0.4rem;
  line-height: 1.35;
  opacity: 0.92;
}
.field__hint code {
  font-size: 0.85em;
  padding: 0.05em 0.25em;
  border-radius: 4px;
  background: var(--code-bg);
}

.input {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 1.125rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}
.input:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 0;
  border-color: var(--link);
  box-shadow: inset 0 0 0 1px var(--link);
}
.input::placeholder {
  color: #98a2b3;
  opacity: 1;
}
.input--select { appearance: auto; cursor: pointer; }
.input--area { min-height: 120px; resize: vertical; }

.check { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; cursor: pointer; }

.link-muted { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Marca LUMIN ---------- */

.brand-lockup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.brand-lockup--hero {
  flex-direction: column;
  gap: 0.5rem;
}

.brand-lockup__mark {
  display: flex;
}

.brand-lockup__text {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 1.35rem;
  color: var(--text);
}

.brand-lockup--hero .brand-lockup__text {
  font-size: 1.5rem;
  letter-spacing: 0.06em;
}

.brand-lockup--inline .brand-lockup__text {
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.brand-lockup--inline .brand-lockup__mark {
  filter: none;
}

.brand-lockup--has-file-logo .brand-lockup__mark {
  filter: none;
}

.brand-lockup__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
}

.brand-lockup__img--hero {
  max-height: clamp(72px, 18vw, 132px);
  max-width: min(300px, 88vw);
}

.brand-lockup__img--card {
  max-height: 56px;
  max-width: 220px;
}

.brand-lockup__img--inline {
  max-height: 32px;
  max-width: 140px;
}

.brand-lockup--hero-logo .brand-lockup__text {
  display: none;
}

.brand-lockup--wordmark-only {
  justify-content: center;
  width: 100%;
}

.brand-lockup--wordmark-only .brand-lockup__mark {
  justify-content: center;
  width: 100%;
  max-width: min(100%, 22rem);
}

.brand-lockup--wordmark-only .brand-lockup__img--card {
  max-height: 72px;
  max-width: min(100%, 300px);
  margin: 0 auto;
}

.brand-lockup--wordmark-only .brand-lockup__img--inline {
  max-height: 38px;
  max-width: min(100%, 220px);
}

.brand-lockup--wordmark-only .brand-lockup__img--hero {
  max-height: clamp(88px, 24vw, 150px);
  max-width: min(94vw, 440px);
}

.landing-heading {
  margin: 0;
  line-height: 1.15;
  text-align: center;
}

.landing-card .landing-heading + .landing-sub--realm {
  text-align: center;
}

.landing-card .landing-tagline {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.landing-card .btn-landing {
  display: flex;
  margin-left: auto;
  margin-right: auto;
  max-width: 20rem;
  justify-content: center;
}

.login-brand,
.register-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 0.35rem;
}

/* ---------- Landing ---------- */

.page-landing {
  min-height: 100vh;
  display: block;
  background-color: #e5edf7;
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(0, 86, 179, 0.1), transparent 50%),
    linear-gradient(180deg, #f4f7fc 0%, #e5edf7 35%, #d8e4f2 100%);
}

.landing-splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 1.5rem 1.25rem 2.5rem;
  box-sizing: border-box;
}

.landing-main {
  padding: 0;
  width: 100%;
  max-width: 440px;
  flex-shrink: 0;
}

@media (min-width: 960px) {
  .landing-splash {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    padding: 2rem 2rem 3rem;
  }
  .realm-flag-wrap {
    order: 0;
  }
  .landing-main {
    order: 1;
    max-width: 460px;
  }
}

/* ---------- Estandarte (bandera del reino) ---------- */

.realm-flag-wrap {
  text-align: center;
  max-width: 320px;
  width: 100%;
}

.realm-flag-frame {
  position: relative;
  padding: 0.5rem;
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-hover);
}

.realm-flag-inner {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--canvas);
  border: 1px solid var(--border-light);
}

.realm-flag__img {
  width: 100%;
  height: auto;
  max-height: min(52vh, 420px);
  object-fit: contain;
  margin: 0 auto;
}

.realm-flag__label {
  margin: 0.75rem 0 0.15rem;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-muted);
}

.realm-flag__subl {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text);
}

.landing-card {
  text-align: left;
  padding: 2.2rem 2.1rem 2.35rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-left: 6px solid var(--primary);
  border-radius: var(--radius-auth-card);
  box-shadow: 0 20px 50px rgba(12, 17, 29, 0.1), 0 2px 8px rgba(0, 86, 179, 0.06);
  position: relative;
  overflow: hidden;
}

.landing-sub {
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.landing-sub--realm {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  margin-top: 1.25rem;
  line-height: 1.3;
}

.landing-tagline {
  margin: 0.75rem 0 0;
  max-width: 28rem;
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--text-muted);
  font-weight: 400;
}

.landing-realm-foot {
  margin: 1.75rem 0 0;
  font-family: var(--font);
  font-size: 0.875rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.btn-landing {
  margin-top: 1.5rem;
  padding: 0.9rem 2.25rem;
  font-size: 1.05rem;
  text-decoration: none;
  border-radius: var(--radius-pill);
}

.btn-landing:hover {
  text-decoration: none;
}

.landing-foot {
  margin: 1.25rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

.landing-flash {
  text-align: left;
  margin-top: 1rem;
}

/* ---------- Cabecera servicios (login / registro / portada) ---------- */

.auth-service-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.auth-service-main {
  flex: 1;
}

.auth-service-header {
  flex-shrink: 0;
  background: linear-gradient(118deg, #003d82 0%, #0056b3 42%, #156cc4 100%);
  color: #f0fafc;
  border-bottom: 3px solid #7eb8f0;
  padding: 0.75rem 1.15rem;
  box-shadow: 0 4px 20px rgba(0, 50, 120, 0.32);
}

.auth-service-header__inner {
  max-width: 60rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 1rem;
  line-height: 1.5;
}

.auth-service-header__inner--split {
  justify-content: space-between;
  width: 100%;
}

.auth-service-header__inner--spread {
  width: 100%;
  justify-content: space-between;
  align-items: center;
}

.auth-service-header__cluster {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.auth-service-header__tagline {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.auth-service-header a.auth-service-header__link {
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}

.auth-service-header a.auth-service-header__link:hover {
  color: #e0f7fa;
  border-bottom-color: rgba(224, 247, 250, 0.85);
}

.auth-service-header__link--strong {
  font-weight: 700;
}

.auth-service-header__sep {
  color: rgba(255, 255, 255, 0.45);
  opacity: 1;
  user-select: none;
}

.auth-service-header__name {
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #ffffff;
}

.theme-fab {
  display: none;
}

/* ---------- Login ---------- */

.page-login {
  min-height: 100vh;
  position: relative;
  color: var(--text);
  background-color: #e5edf7;
  background-image:
    radial-gradient(ellipse 85% 55% at 50% 0%, rgba(0, 86, 179, 0.1), transparent 52%),
    linear-gradient(180deg, #f4f7fc 0%, #e5edf7 38%, #d8e4f2 100%);
}

.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 3rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
}

.login-main--split {
  align-items: stretch;
}

/* Login / registro: emblema al lado del formulario */
.auth-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  width: 100%;
  max-width: 56rem;
  margin: 0 auto;
  align-items: start;
}

.auth-split--no-emblem {
  max-width: 26.5rem;
}

.auth-split__aside {
  order: -1;
}

.auth-split__aside-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 0;
  padding: 0.5rem 0.75rem 1rem;
  color-scheme: light;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* Solo centra el emblema; sin caja blanca alrededor del PNG */
.auth-split__emblem-wrap {
  display: block;
  max-width: min(280px, 72vw);
  margin: 0 auto;
  padding: 0;
  line-height: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.auth-split__emblem {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  background-color: transparent;
  /* Nunca aplicar filter al PNG con transparencia: en Blink/WebKit suele pintar el alfa como negro */
  filter: none;
  -webkit-filter: none;
}

.auth-split__emblem-fallback {
  display: none;
  margin: 0;
  max-width: 16rem;
  padding: 1rem 1.15rem;
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.auth-split__aside-panel.is-emblem-missing .auth-split__emblem-wrap {
  display: none;
}

.auth-split__aside-panel.is-emblem-missing .auth-split__emblem {
  display: none;
}

.auth-split__aside-panel.is-emblem-missing .auth-split__emblem-fallback {
  display: block;
}

.auth-split__form {
  width: 100%;
  min-width: 0;
}

@media (min-width: 900px) {
  .auth-split:not(.auth-split--no-emblem) {
    grid-template-columns: minmax(248px, 40%) 1fr;
    gap: 2.25rem;
    align-items: stretch;
  }

  .auth-split:not(.auth-split--no-emblem) .auth-split__aside {
    order: 0;
  }

  .auth-split:not(.auth-split--no-emblem) .auth-split__aside-panel {
    min-height: 100%;
    padding: 0.75rem 0.5rem 1rem;
  }

  .auth-split:not(.auth-split--no-emblem) .auth-split__emblem-wrap {
    max-width: 100%;
  }

  .auth-split:not(.auth-split--no-emblem) .auth-split__emblem {
    max-width: 100%;
  }
}

.login-card {
  width: 100%;
  max-width: 28rem;
  padding: 2.35rem 2.1rem 2.1rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-left: 6px solid var(--primary);
  color: var(--text);
  box-shadow: 0 20px 50px rgba(12, 17, 29, 0.1), 0 2px 8px rgba(0, 86, 179, 0.06);
  border-radius: var(--radius-auth-card);
  position: relative;
}

.login-card__head {
  text-align: center;
  margin-bottom: 1.75rem;
  padding-bottom: 0.25rem;
}

.login-card__head::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  margin: 1.25rem auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--link), transparent);
  opacity: 0.9;
}

.login-card__eyebrow {
  margin: 0.75rem 0 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}

.login-title {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.25;
  text-transform: uppercase;
  color: var(--text);
}

.login-sub {
  margin: 0.65rem auto 0;
  max-width: 22rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
  text-wrap: balance;
}

.field--auth {
  margin-bottom: 1.15rem;
}

.input--auth {
  border-radius: var(--radius-lg);
  font-size: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input--auth::placeholder {
  color: #98a2b3;
}

.input--auth:hover {
  border-color: #98a2b3;
}

.input--auth:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 0;
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.12);
  background: #ffffff;
}

.field--invalid .input--auth {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12);
}

.login-form .input--auth {
  width: 100%;
}

.check--auth {
  font-size: 0.875rem;
  color: var(--text-muted);
  align-items: flex-start;
}

.check--auth input {
  margin-top: 0.2rem;
}

.login-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.35rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border-light);
}

.login-row__link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.login-row__link:hover {
  color: var(--link-hover);
  border-bottom-color: currentColor;
}

.btn--auth-submit {
  margin-top: 0.25rem;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  border-radius: var(--radius-pill);
}

.login-foot {
  text-align: center;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.login-foot__line {
  margin: 0 0 0.5rem;
}

.login-foot__line a {
  font-weight: 600;
}

.login-foot__meta {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  opacity: 0.82;
}

.recover-link-wrap { margin: 1rem 0 0; }
.recover-hint {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
  text-align: left;
}
.recover-code {
  display: block;
  margin-top: 0.4rem;
  padding: 0.55rem 0.65rem;
  background: var(--parchment-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.72rem;
  word-break: break-all;
  color: var(--text);
}

/* Login / recuperar — formulario más bajo (menos altura) */
.page-login .login-main {
  padding: 1rem 1rem 1.5rem;
}
.page-login .auth-split {
  gap: 1.15rem;
}
.page-login .login-card {
  padding: 1.25rem 1.35rem 1.15rem;
}
.page-login .login-card__head {
  margin-bottom: 0.95rem;
}
.page-login .login-card__head::after {
  margin-top: 0.55rem;
  height: 2px;
}
.page-login .login-card__eyebrow {
  margin-top: 0.25rem;
  font-size: 0.625rem;
}
.page-login .login-title {
  margin-top: 0.1rem;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.page-login .login-sub {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  line-height: 1.4;
}
.page-login .login-form .field--auth {
  margin-bottom: 0.65rem;
}
.page-login .login-form .input--auth {
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
}
.page-login .login-row {
  margin-bottom: 0.75rem;
  padding-top: 0.1rem;
  gap: 0.5rem 0.75rem;
}
.page-login .btn--auth-submit {
  margin-top: 0;
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  font-size: 0.9375rem;
}
.page-login .login-foot {
  margin-top: 1rem;
  padding-top: 0.7rem;
  font-size: 0.8125rem;
}
.page-login .login-foot__meta {
  font-size: 0.7rem;
}

/* ---------- Registro ---------- */

.page-register {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background-color: #e5edf7;
  background-image:
    radial-gradient(ellipse 88% 50% at 12% 0%, rgba(0, 86, 179, 0.09), transparent 48%),
    linear-gradient(180deg, #f4f7fc 0%, #e5edf7 32%, #d8e4f2 100%);
}

.register-main {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem 1rem 1.6rem;
  box-sizing: border-box;
}

.register-main--split {
  max-width: 58rem;
}

.register-card__brand-spacer {
  flex: 1;
  min-width: 0;
}

.register-card {
  position: relative;
  padding: 1.2rem 1.35rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-left: 6px solid var(--primary);
  box-shadow: 0 20px 50px rgba(12, 17, 29, 0.1), 0 2px 8px rgba(0, 86, 179, 0.06);
  border-radius: var(--radius-auth-card);
  overflow: hidden;
}

.register-card__head {
  text-align: left;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.register-card__brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.register-card__head .register-brand {
  justify-content: flex-start;
  margin-bottom: 0;
}

.register-card__badge {
  flex-shrink: 0;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffffff;
  background: var(--primary);
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.register-card__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
}

.register-title {
  margin: 0.1rem 0 0;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.register-sub {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  max-width: 36rem;
}

.register-section-heading {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  border: none;
}

.register-section-heading--divider {
  margin-top: 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.field__req {
  color: var(--error);
  font-weight: 700;
}

.page-register .input--auth,
.page-register .input--select.input--auth {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-lg);
  font-size: 1rem;
}

.page-register .input--auth:focus,
.page-register .input--select.input--auth:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 0;
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.12);
}

.page-register .input--select.input--auth {
  cursor: pointer;
  padding-right: 2rem;
}

.register-user-notice { text-align: left; }
.register-user-notice__title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 800;
}
.register-user-notice__text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  opacity: 0.95;
}

.register-admin-only {
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.register-admin-only summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}
.register-admin-only__body {
  margin: 0.5rem 0 0;
  padding: 0.65rem 0.75rem;
  background: var(--parchment-deep);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  line-height: 1.45;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.35rem 0.85rem;
}
.field--full { grid-column: 1 / -1; }

@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .field--full { grid-column: auto; }
}

.page-register .register-form .form-grid > label.field {
  margin-bottom: 0;
}

.page-register .register-form .form-grid > .register-section-heading {
  padding-bottom: 0.35rem;
}

.page-register .register-form .field__hint {
  margin: 0;
  line-height: 1.3;
}

.page-register .register-form .input--auth,
.page-register .register-form .input--select.input--auth {
  padding-top: 0.48rem;
  padding-bottom: 0.48rem;
  font-size: 0.9375rem;
}

.btn-register {
  margin-top: 0.55rem;
  padding-top: 0.58rem;
  padding-bottom: 0.58rem;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  border-radius: var(--radius-pill);
}

.register-login-link {
  text-align: center;
  margin-top: 0.65rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.register-login-link a {
  font-weight: 700;
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.register-login-link a:hover {
  color: var(--link-hover);
  border-bottom-color: currentColor;
}

.page-register .check--legal {
  padding: 0.45rem 0.6rem 0.45rem 0.55rem;
  background: var(--parchment);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  line-height: 1.35;
}

.check--auth-legal {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.check--auth-legal span:last-child {
  color: var(--text);
  opacity: 0.95;
}

@media (max-width: 540px) {
  .landing-card {
    padding: 2rem 1.5rem;
  }
  .brand-lockup--hero .brand-lockup__text {
    font-size: 1.65rem;
    letter-spacing: 0.14em;
  }
  .register-card {
    padding: 1rem 1rem 1.15rem;
  }
  .login-card {
    padding: 1.2rem 1.15rem 1.1rem;
  }
  .login-title {
    font-size: 1.35rem;
  }
  .page-login .login-card {
    padding: 1.05rem 1.05rem 1rem;
  }
  .page-login .login-title {
    font-size: 1.08rem;
  }
}

@media (max-width: 520px) {
  .auth-service-header__inner--spread {
    flex-direction: column;
    align-items: flex-start;
  }
  .auth-service-header__tagline {
    width: 100%;
    padding-left: 0.15rem;
  }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  padding: 0.5rem 1rem;
  background: var(--bar-bg);
  color: var(--white);
  border-radius: 8px;
  font-weight: 600;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  outline: 3px solid var(--focus-ring);
  outline-offset: 0;
}

.register-toplink {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}
.register-toplink a { font-weight: 600; }

.register-summary-error { margin-bottom: 1rem; }

.register-fieldset {
  border: 1px solid var(--border);
  border-radius: 16px;
  margin: 0 0 1.5rem;
  padding: 1.15rem 1.2rem 0.25rem;
  background: var(--parchment);
}
.register-section-title {
  padding: 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
}
.register-section-desc {
  margin: 0.35rem 0 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.field--invalid .input,
.field--invalid .input--select,
.field--invalid .input--auth {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12);
}
.field__error {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #b42318;
}

.field--pass .password-wrap {
  display: flex;
  width: 100%;
  align-items: stretch;
  gap: 0;
}
.field--pass .input--password {
  flex: 1;
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.btn-password-toggle {
  flex-shrink: 0;
  padding: 0 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: var(--link);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 12px 12px 0;
  transition: background 0.15s ease;
}
.btn-password-toggle:hover {
  background: var(--border-light);
}

.field--check.field--full { grid-column: 1 / -1; }

.check--legal {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.6rem;
  line-height: 1.45;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.check--legal input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.register-pass-match--ok { color: #067647 !important; font-weight: 600; }
.register-pass-match--bad { color: #d92d20 !important; font-weight: 600; }

/* ---------- App shell (dashboard / catastro) ---------- */

.page-app {
  background-color: #e8eef7;
  background-image: radial-gradient(ellipse 100% 80% at 50% 0%, rgba(0, 86, 179, 0.06), transparent 55%);
  min-height: 100vh;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  min-height: 100vh;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: var(--sidebar-w-collapsed) 1fr;
}

.topbar {
  grid-area: topbar;
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem 0 0.5rem;
  background: #ffffff;
  border-bottom: 3px solid var(--glacier);
  box-shadow: 0 2px 14px rgba(0, 86, 179, 0.08);
  height: var(--topbar-h);
}

.topbar__left { display: flex; align-items: center; gap: 0.35rem; }

.icon-btn {
  width: 44px; height: 44px;
  border: none;
  background: transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover {
  background: var(--parchment);
  color: var(--link);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  letter-spacing: 0;
}
.topbar__brand,
.topbar__brand:hover { text-decoration: none; }
.topbar__brand:hover { color: var(--link-hover); }
.topbar__brand .brand-lockup { gap: 0.5rem; align-items: center; }
.topbar__brand .brand-lockup__text { font-size: 1.02rem; }
.topbar__brand .brand-lockup__mark { display: flex; align-items: center; }

.topbar__right { display: flex; align-items: center; gap: 1rem; }

.topbar__date {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.user-menu { position: relative; }

.user-menu__btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.user-menu__btn:hover {
  background: var(--parchment);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.user-menu__avatar { font-size: 1rem; opacity: 0.8; }
.user-menu__caret { font-size: 0.7rem; color: var(--text-muted); }

.user-menu__dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-hover);
  min-width: 200px;
  z-index: 60;
}
.user-menu__dropdown a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
}
.user-menu__dropdown a:hover { background: var(--canvas); color: var(--text); text-decoration: underline; }

.sidebar {
  grid-area: sidebar;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  background: linear-gradient(180deg, #f8fafc 0%, #f2f4f7 100%);
  border-right: 1px solid var(--border-light);
  padding: calc(var(--topbar-h) + 0.5rem) 0.5rem 1rem;
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease;
  overflow: hidden;
}

.sidebar__nav { display: flex; flex-direction: column; gap: 0.35rem; }

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-lg);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.sidebar__link:hover {
  background: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  color: var(--link);
}
.sidebar__link.is-active {
  background: #ffffff;
  color: var(--text);
  border-left-color: var(--link);
  box-shadow: var(--shadow-sm);
}

.sidebar__ico { width: 1.5rem; text-align: center; font-size: 1.1rem; }

.app-shell.sidebar-collapsed .sidebar__txt { display: none; }
.app-shell.sidebar-collapsed .sidebar__link { justify-content: center; padding: 0.75rem; }

.app-main {
  grid-area: main;
  padding: clamp(1.1rem, 2.5vw, 1.85rem);
  min-height: calc(100vh - var(--topbar-h));
}

.page-app:not(.page-catastro) .app-main:not(.app-main--catastro) {
  margin: 1rem 1rem 1.25rem 0.65rem;
  box-sizing: border-box;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(12, 17, 29, 0.08);
}

@media (max-width: 768px) {
  .page-app:not(.page-catastro) .app-main:not(.app-main--catastro) {
    margin: 0.75rem;
    border-radius: 16px;
  }
}

.page-heading {
  margin: 0 0 1.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
}

/* ---------- Dashboard tarjetas ---------- */

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: 1.35rem;
}

.dash-card {
  padding: 1.35rem 1.45rem 1.5rem;
  border-radius: var(--radius-xl);
  transition: box-shadow 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.dash-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--border);
}

.dash-card--wide {
  grid-column: 1 / -1;
}

.dash-card__title {
  position: relative;
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text);
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-light);
}

.dash-card__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 2.75rem;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--glacier));
}

.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.btn-row--wrap { justify-content: flex-start; }

/* Credencial / flip */

.cred-flip { perspective: 1200px; margin-bottom: 0.5rem; }

.cred-flip__inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s ease;
  min-height: 280px;
}

.cred-flip__inner.is-flipped { transform: rotateY(180deg); }

.cred {
  backface-visibility: hidden;
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  border: 1px solid var(--border-light);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.cred--front { position: relative; }

.cred--back {
  position: absolute;
  top: 0; left: 0; right: 0;
  transform: rotateY(180deg);
  min-height: 280px;
  background: var(--parchment);
  color: var(--text);
  border-color: var(--border-light);
}

.cred__header { display: flex; gap: 0.75rem; align-items: flex-start; margin-bottom: 1rem; }
.cred__seal { font-size: 1.75rem; }
.cred__state {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.75rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  font-weight: 600;
}
.cred__doc { margin: 0.15rem 0 0; font-size: 0.85rem; color: var(--text-muted); }

.cred__photo { float: right; margin-left: 1rem; border-radius: 12px; overflow: hidden; border: 2px solid var(--border-light); }

.cred__data { margin: 0; display: grid; gap: 0.5rem; clear: both; }
.cred__data dt { font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); margin: 0; }
.cred__data dd { margin: 0; font-weight: 700; font-size: 0.9rem; }

.cred__back-title { margin: 0 0 0.75rem; font-weight: 700; }
.cred__back-text { margin: 0; font-size: 0.9rem; opacity: 0.9; line-height: 1.55; }
.cred__back-code { margin-top: 1rem; font-family: ui-monospace, monospace; font-size: 0.85rem; color: var(--link); }

.kv-list { list-style: none; margin: 0; padding: 0; }
.kv-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.95rem;
}
.kv-list li:last-child {
  border-bottom: none;
}
.kv-list__k { color: var(--text-muted); }
.kv-list__v { font-weight: 600; text-align: right; }

.cv-entry {
  padding: 1rem 1.1rem;
  background: var(--parchment);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 0.75rem;
}
.cv-entry__org { margin: 0; font-weight: 700; color: var(--text); }
.cv-entry__person { margin: 0.35rem 0 0; font-size: 0.95rem; }
.cv-entry__dates { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--text-muted); }

.inst-list { margin: 0; padding-left: 1.2rem; }
.inst-list li { margin-bottom: 0.6rem; }

/* ---------- Catastro ---------- */

.page-catastro .app-main--catastro {
  padding: 0;
  background: var(--canvas);
}

.app-shell--catastro .app-main { background: var(--canvas); }

.catastro-workspace {
  position: relative;
  min-height: calc(100vh - var(--topbar-h));
  padding: 1rem;
  padding-bottom: 5rem;
}

@media (min-width: 900px) {
  .catastro-workspace { padding-right: 300px; }
}

.map-stage { position: relative; max-width: 1100px; margin: 0 auto; }

.map-search-float {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: min(420px, calc(100% - 2rem));
}

.map-search-input {
  width: 100%;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-xl);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.map-search-input:hover {
  border-color: #98a2b3;
}
.map-search-input:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 0;
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.12);
}

.map-search-results {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0.35rem 0;
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-hover);
  max-height: 200px;
  overflow-y: auto;
  display: none;
}
.map-search-results.is-visible { display: block; }

.map-search-results li button {
  width: 100%;
  text-align: left;
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 8px;
}
.map-search-results li button:hover { background: var(--info-tint); }

.map-frame {
  position: relative;
  margin-top: 3.5rem;
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-hover);
  overflow: hidden;
  min-height: 320px;
}

.map-image {
  width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: contain;
  background: var(--canvas);
}

.map-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.map-overlay--tav.is-on { opacity: 1; }

.map-frame.measure-mode::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 3px dashed var(--violet);
  border-radius: var(--radius-xl);
  pointer-events: none;
  animation: pulse-border 1.5s ease infinite;
}

@keyframes pulse-border {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.map-measure-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  z-index: 15;
  box-shadow: var(--shadow);
}

.catastro-panel {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  right: 12px;
  width: min(280px, calc(100vw - 24px));
  max-height: calc(100vh - var(--topbar-h) - 100px);
  overflow-y: auto;
  z-index: 40;
  padding: 1.25rem 1rem;
}

.catastro-panel.is-hidden { display: none; }

.catastro-panel__close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--canvas);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}

.catastro-panel__title {
  margin: 0 2rem 0.25rem 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
}
.catastro-panel__subtitle { margin: 0 0 1rem; font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

.panel-section { margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.panel-section:last-of-type { border-bottom: none; }

.panel-section__title { margin: 0 0 0.65rem; font-size: 0.875rem; text-transform: none; letter-spacing: 0; color: var(--text-muted); font-weight: 600; }

.panel-reopen {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  right: 12px;
  z-index: 35;
}

.catastro-bottombar {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-hover);
  z-index: 45;
}

@media (max-width: 600px) {
  .catastro-bottombar {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: var(--radius-xl);
    max-width: calc(100% - 24px);
  }
  .catastro-panel {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    max-height: none;
    margin-top: 1rem;
  }
  .catastro-workspace { padding-right: 1rem; }
}

/* Grid móvil: sidebar bajo topbar */
@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) auto 1fr;
    grid-template-areas:
      "topbar"
      "sidebar"
      "main";
  }
  .sidebar {
    position: relative;
    height: auto;
    flex-direction: row;
    padding: 0.5rem;
    overflow-x: auto;
  }
  .sidebar__nav { flex-direction: row; flex-wrap: nowrap; }
  .sidebar__link { white-space: nowrap; }
  .app-shell.sidebar-collapsed { grid-template-columns: 1fr; }
}

/* Mensajes de formulario (login / registro / panel) */
.form-flash {
  margin: 0 0 1rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-xl);
  font-size: 0.9375rem;
  line-height: 1.45;
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--border);
}
.form-flash--error {
  background: #fef3f2;
  color: #b42318;
  border-color: #fecdca;
  border-left-color: var(--error);
}
.form-flash--ok {
  background: #ecfdf3;
  color: #027a48;
  border-color: #abefc6;
  border-left-color: var(--success);
}
.form-flash--info {
  background: var(--info-tint);
  color: var(--text);
  border-color: #c5daf5;
  border-left-color: var(--link);
}
.dash-page-flash {
  grid-column: 1 / -1;
  max-width: 42rem;
}

.register-meta {
  font-weight: 500;
  opacity: 0.95;
}

.input:focus-visible,
.input--select:focus-visible,
.btn:focus-visible,
.theme-fab:focus-visible,
.icon-btn:focus-visible,
.check input:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 0;
}

.auth-service-header__tag {
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
}

/* Portada: refuerzo si quedara CSS antiguo en caché intermedia */
body.page-landing {
  background-color: #e5edf7 !important;
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -8%, rgba(0, 86, 179, 0.1), transparent 50%),
    linear-gradient(180deg, #f4f7fc 0%, #e5edf7 35%, #d8e4f2 100%) !important;
  color: #0c111d !important;
}
body.page-landing .landing-card {
  background: #ffffff !important;
  border: 1px solid #e2ebf0 !important;
  border-left: 6px solid #0056b3 !important;
  border-radius: 20px !important;
  box-shadow: 0 20px 50px rgba(12, 17, 29, 0.1), 0 2px 8px rgba(0, 86, 179, 0.06) !important;
}
body.page-landing .btn-landing.btn-gradient {
  background: #0056b3 !important;
  border: 1px solid #004494 !important;
  color: #ffffff !important;
  border-radius: 999px !important;
  box-shadow: 0 1px 2px rgba(0, 68, 148, 0.22) !important;
  filter: none !important;
}