/* Portal Mediterráneo — estilos base. Paleta y reglas en CLAUDE.md (Diseño). */

:root {
  --egeo: #0C4A6E;
  --egeo-oscuro: #083550;
  --egeo-claro: #E3EEF4;
  --arena: #F3EEE4;
  --blanco: #FFFFFF;
  --rojo: #C9412B;
  --ambar: #B07A1E;
  --verde: #2E7D4F;
  --texto: #1C2B33;
  --texto-suave: #5B6B73;
  --borde: #DDD5C6;

  --radio: 12px;
  --sombra: 0 1px 2px rgba(12, 74, 110, .08), 0 4px 12px rgba(12, 74, 110, .06);
  --alto-barra: 64px;
  --alto-pestanas-movil: 64px;
  --toque: 44px;
}

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

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

body {
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--texto);
  background: var(--arena);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
a { color: var(--egeo); }

:focus-visible { outline: 3px solid var(--ambar); outline-offset: 2px; }

/* ── Botones ─────────────────────────────────────────── */

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: var(--toque);
  min-width: var(--toque);
  padding: 0 1.25em;
  border: 2px solid var(--egeo);
  border-radius: var(--radio);
  background: var(--egeo);
  color: var(--blanco);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.boton:hover { background: var(--egeo-oscuro); border-color: var(--egeo-oscuro); }
.boton:disabled { opacity: .45; cursor: not-allowed; }

.boton-secundario { background: transparent; color: var(--egeo); }
.boton-secundario:hover { background: var(--egeo-claro); }

.boton-peligro { background: var(--rojo); border-color: var(--rojo); }
.boton-grande { min-height: 64px; font-size: 1.125rem; width: 100%; }

/* ── Tarjetas ────────────────────────────────────────── */

.tarjeta {
  background: var(--blanco);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 1.25rem;
}

/* ── Páginas sueltas (entrada, error) ────────────────── */

body.suelta {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 1rem;
}
.tarjeta-centro {
  width: min(100%, 440px);
  text-align: center;
  padding: 2rem 1.5rem;
}
.codigo-error { font-size: 3rem; font-weight: 700; color: var(--egeo); margin: 0; }
.acciones-entrada { display: grid; gap: .75rem; margin: 1.5rem 0 1rem; }
.nota { font-size: .875rem; color: var(--texto-suave); }

/* ── Formularios y alertas ───────────────────────────── */

.formulario { display: grid; gap: 1rem; text-align: left; margin-top: 1rem; }
.campo { display: grid; gap: .35rem; font-weight: 600; }
.campo input, .campo select {
  min-height: var(--toque);
  padding: 0 .75rem;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  background: var(--blanco);
  font: inherit;
  font-weight: 400;
  color: var(--texto);
}
.campo input:focus, .campo select:focus { border-color: var(--egeo); }

.alerta {
  padding: .75rem 1rem;
  border-radius: var(--radio);
  border-left: 6px solid var(--rojo);
  background: #FBEDEA;
  text-align: left;
}

.banda-dev {
  display: inline-block;
  margin: 0 0 1rem;
  padding: .25rem .75rem;
  border-radius: 999px;
  background: var(--ambar);
  color: var(--blanco);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ── Barra superior ──────────────────────────────────── */

.barra {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--alto-barra);
  padding: 0 1rem;
  background: var(--egeo);
  color: var(--blanco);
}

.marca { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; font-weight: 700; }
.marca-logo {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--arena);
  color: var(--egeo);
  font-weight: 700;
}
.marca-logo-grande { width: 64px; height: 64px; font-size: 1.75rem; margin-bottom: 1rem; background: var(--egeo); color: var(--blanco); }

.pestanas { display: flex; gap: .25rem; flex: 1; justify-content: center; }
.pestana {
  display: inline-flex;
  align-items: center;
  min-height: var(--toque);
  padding: 0 1rem;
  border-radius: var(--radio);
  color: var(--blanco);
  text-decoration: none;
  font-weight: 600;
  opacity: .8;
}
.pestana:hover { opacity: 1; background: rgba(255, 255, 255, .08); }
.pestana.activa { opacity: 1; background: var(--arena); color: var(--egeo); }

.usuario { display: flex; align-items: center; gap: .75rem; }
.usuario form { margin: 0; }
.usuario .boton-secundario { color: var(--blanco); border-color: rgba(255, 255, 255, .6); }
.usuario .boton-secundario:hover { background: rgba(255, 255, 255, .12); }

.chip { display: flex; flex-direction: column; line-height: 1.15; text-align: right; }
.chip-nombre { font-weight: 600; }
.chip-rol { font-size: .75rem; opacity: .8; }

/* ── Contenido ───────────────────────────────────────── */

.contenido { padding: 1.5rem 1rem; max-width: 1200px; margin: 0 auto; }
.titulo-pagina { font-size: 1.5rem; color: var(--egeo); }

.rejilla-tarjetas {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.dato-etiqueta { margin: 0; color: var(--texto-suave); font-weight: 600; font-size: .875rem; }
.dato-valor { margin: .25rem 0 0; font-size: 2.25rem; font-weight: 700; color: var(--egeo); }

/* Pestañas que cargan una app existente en iframe: ocupan todo el alto disponible. */
.contenido.pantalla-iframe { max-width: none; padding: 0; height: calc(100dvh - var(--alto-barra)); }
.contenido.pantalla-iframe iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--blanco); }

/* ── Aviso de inactividad ────────────────────────────── */

.aviso-inactividad {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: min(calc(100% - 2rem), 480px);
  padding: 1rem 1.25rem;
  border-radius: var(--radio);
  background: var(--blanco);
  border-left: 6px solid var(--ambar);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.aviso-inactividad[hidden] { display: none; }
.aviso-inactividad p { margin: 0; flex: 1; }

/* ── Celular: pestañas abajo ─────────────────────────── */

@media (max-width: 760px) {
  .marca-texto, .chip-rol { display: none; }
  .barra { justify-content: space-between; }

  .pestanas {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--alto-pestanas-movil) + env(safe-area-inset-bottom));
    padding: .5rem .5rem calc(.5rem + env(safe-area-inset-bottom));
    background: var(--egeo);
    justify-content: space-around;
    overflow-x: auto;
  }
  .pestana { padding: 0 .75rem; font-size: .875rem; }

  .contenido { padding-bottom: calc(var(--alto-pestanas-movil) + 1.5rem + env(safe-area-inset-bottom)); }
  .contenido.pantalla-iframe {
    height: calc(100dvh - var(--alto-barra) - var(--alto-pestanas-movil) - env(safe-area-inset-bottom));
    padding-bottom: 0;
  }
  .aviso-inactividad { bottom: calc(var(--alto-pestanas-movil) + 1rem); }
}
