*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--fuente); color: var(--texto); background: var(--blanco);
  line-height: 1.5; -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }   /* que .boton y similares no anulen el atributo hidden */
h1, h2, h3 { line-height: 1.2; margin: 0; }

/* Foco visible para teclado (WCAG) */
:focus-visible { outline: 3px solid #0B5C56; outline-offset: 2px; }

.solo-lector {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.saltar {
  position: absolute; left: -999px; top: 8px; background: var(--verde); color: #fff;
  padding: 8px 14px; border-radius: 8px; z-index: 200;
}
.saltar:focus { left: 8px; }

.contenedor { width: min(1200px, 100% - 32px); margin-inline: auto; }

/* Botones */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 10px 18px; font: 600 .95rem var(--fuente);
  text-decoration: none; cursor: pointer; min-height: 44px;
}
.boton-verde { background: var(--verde); color: #fff; }
.boton-verde:hover { background: var(--verde-oscuro); }
.boton-naranja { background: var(--naranja); color: #fff; }
.boton-naranja:hover { background: var(--naranja-oscuro); }
.boton-borde { background: transparent; border: 1.5px solid var(--verde); color: var(--verde); }

/* ---------- Barra de navegación ---------- */
.navbar { position: sticky; top: 0; z-index: 100; background: #fff; box-shadow: 0 1px 0 var(--borde); }
.navbar-interior {
  height: var(--alto-nav); display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--verde); text-decoration: none; font-size: 1.1rem; }
.logo svg { width: 32px; height: 32px; }
.nav-centro { display: flex; gap: 8px; }
.nav-enlace { padding: 8px 18px; border-radius: 999px; text-decoration: none; font-weight: 500; min-height: 40px; display: inline-flex; align-items: center; }
.nav-enlace:hover { background: var(--fondo-calido); }
.nav-enlace.activo { background: var(--verde-claro); }
.nav-derecha { display: flex; align-items: center; gap: 12px; }
/* Botones de cuenta (Salir, Ingresar, Perfil): con borde y sombra para que se note que se pueden pulsar */
.nav-boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 44px;
  padding: 0 14px; border: 1.5px solid #CBD5E1; border-radius: 10px; background: #fff; color: var(--texto);
  font: 600 .9rem var(--fuente); text-decoration: none; cursor: pointer; box-shadow: var(--sombra);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.nav-boton:hover { background: var(--fondo-calido); border-color: var(--verde); box-shadow: var(--sombra-fuerte); }
.nav-boton svg { width: 18px; height: 18px; flex: none; }
.nav-perfil { padding: 0 10px 0 5px; border-radius: 999px; }
.nav-perfil.activo { background: var(--verde-claro); border-color: var(--verde); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--verde); color: #fff;
  display: grid; place-items: center; flex: none;
}
.nav-perfil .nav-flecha { width: 14px; height: 14px; color: var(--texto-suave); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; border-radius: 8px; }
.nav-toggle svg { width: 26px; height: 26px; display: block; }

/* Entre 981 y 1100 px los enlaces se juntan; más angosto pasan al menú desplegable */
@media (max-width: 1100px) { .nav-enlace { padding-inline: 12px; } }
@media (max-width: 980px) {
  .nav-toggle { display: block; order: 3; }
  .nav-centro, .nav-derecha .boton { display: none; }
  .navbar.abierto .nav-centro {
    display: flex; flex-direction: column; position: absolute; top: var(--alto-nav); left: 0; right: 0;
    background: #fff; padding: 12px 16px 16px; box-shadow: var(--sombra); gap: 4px;
  }
  .navbar.abierto .nav-centro .nav-enlace { border-radius: 10px; }
  .navbar.abierto .nav-publicar-movil { display: inline-flex; }
}
.nav-publicar-movil { display: none; }

/* ---------- Alertas ---------- */
.alertas { width: min(1200px, 100% - 32px); margin: 12px auto 0; display: grid; gap: 8px; }
.alerta { padding: 12px 16px; border-radius: 10px; font-weight: 500; }
.alerta-exito { background: #DCFCE7; color: #14532D; }
.alerta-error { background: #FEE2E2; color: #7F1D1D; }
.alerta-aviso { background: #FEF3C7; color: #78350F; }

/* ---------- Pie ---------- */
.pie { background: var(--pie); color: #E5E7EB; text-align: center; padding: 28px 16px; font-size: .9rem; }

/* ---------- Página provisional ---------- */
.pendiente { text-align: center; padding: 96px 16px; }
.pendiente p { color: var(--texto-suave); max-width: 46ch; margin: 12px auto 24px; }

.nav-saludo { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-salir { margin: 0; }
/* En celular quedan solo los íconos; el texto sigue disponible para lectores de pantalla */
@media (max-width: 520px) {
  .nav-derecha { gap: 8px; }
  .nav-saludo, .nav-perfil .nav-flecha { display: none; }
  .nav-perfil { padding: 0 5px; }
  .nav-salir .nav-boton { padding: 0; }
  .nav-salir-texto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
