/* ==========================================================================
   Obrería — hoja de estilos provisional (Bloque B0).
   Identidad NO definitiva: paleta industrial neutra + acento ámbar (alta
   visibilidad). Cuando exista la marca real se reemplazan los tokens.
   Fuentes: stack del sistema (cero peticiones externas, cumple la regla de
   "nunca Google Fonts CDN"; el .woff2 autohospedado llegará con la identidad).
   ========================================================================== */

:root {
  /* Paleta industrial neutra */
  --c-bg: #14181d;          /* grafito */
  --c-surface: #1d232b;     /* acero oscuro */
  --c-surface-2: #262e38;
  --c-border: #333d49;
  --c-text: #e8ecf1;
  --c-text-muted: #9aa7b4;
  --c-accent: #f5a623;      /* ámbar alta visibilidad */
  --c-accent-ink: #14181d;
  --c-danger: #e5534b;
  --c-ok: #3fb950;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;

  --radius: 10px;
  --radius-sm: 6px;
  --maxw: 30rem;

  --font-sys: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sys);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--c-accent);
  color: var(--c-accent-ink);
  padding: var(--space-2) var(--space-4);
  z-index: 100;
}
.skip-link:focus { left: 0; }

.app-root {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Cabecera --------------------------------------------------------------*/
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.brand__mark {
  width: 1.75rem;
  height: 1.75rem;
  display: inline-block;
}
.brand__name { font-size: 1.05rem; }

/* --- Contenido -------------------------------------------------------------*/
.main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
}

.lead {
  color: var(--c-text-muted);
  margin: 0 0 var(--space-5);
}

h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 var(--space-3); }
h2 { font-size: 1.2rem; margin: 0 0 var(--space-3); }

/* --- Tarjeta / formulario --------------------------------------------------*/
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow);
}

.field { margin-bottom: var(--space-4); }
.field label {
  display: block;
  font-size: 0.9rem;
  color: var(--c-text-muted);
  margin-bottom: var(--space-1);
}
.field input,
.field select {
  width: 100%;
  padding: 0.7rem 0.8rem;
  font-size: 1rem;
  color: var(--c-text);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
}
.field input:focus,
.field select:focus {
  outline: 2px solid var(--c-accent);
  outline-offset: 1px;
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn--primary { background: var(--c-accent); color: var(--c-accent-ink); }
.btn--primary:hover { filter: brightness(1.05); }
.btn--ghost {
  background: transparent;
  color: var(--c-text);
  border: 1px solid var(--c-border);
}
.btn:disabled { opacity: 0.6; cursor: default; }

.switch {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-5);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: var(--space-1);
}
.switch button {
  flex: 1;
  padding: 0.55rem;
  font-weight: 700;
  background: transparent;
  color: var(--c-text-muted);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.switch button.is-active { background: var(--c-accent); color: var(--c-accent-ink); }

.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
  font-size: 0.95rem;
}
.alert--error { background: rgba(229, 83, 75, 0.15); border: 1px solid var(--c-danger); color: #f4b3ae; }
.alert--ok { background: rgba(63, 185, 80, 0.12); border: 1px solid var(--c-ok); color: #a7e0b0; }

.muted { color: var(--c-text-muted); font-size: 0.9rem; }
.roles {
  display: inline-flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}
.roles li {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  font-size: 0.8rem;
}

.stack > * + * { margin-top: var(--space-4); }

/* --- Pie -------------------------------------------------------------------*/
.site-footer {
  padding: var(--space-4);
  text-align: center;
  color: var(--c-text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--c-border);
}

.center { text-align: center; }

.fallback { max-width: var(--maxw); margin: 0 auto; padding: var(--space-6) var(--space-4); }

/* --- Pantallas anchas: la experiencia empresa será desktop-first (bloques
   posteriores). Por ahora el shell se mantiene centrado y legible. ---------- */
@media (min-width: 48rem) {
  .main { padding-top: var(--space-6); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
