/* Eraikuntza · Portal de sistemas
   Paleta, fondo con ondas, tipografías y ventanas iguales a Gestión Documental y Álbumes de obra. */
:root {
  --noche: #0b2a4a;
  --azul: #00669e;
  --azul-osc: #00578a;
  --celeste: #4398c8;
  --celeste-claro: #8dbfe3;
  --hielo: #eef4f9;
  --papel: #ffffff;
  --tinta: #1d2b38;
  --tinta-suave: #5a6b7b;
  --borde: #d5e0ea;
  --marca-tinte: #e3f0f9;
  --alerta: #8a5a00;
  --alerta-fondo: #fff6dc;
  --ok: #1f7a4d;
  --radio: 14px;
  --sombra: 0 24px 60px -18px rgba(11, 42, 74, .35), 0 2px 6px rgba(11, 42, 74, .08);
  --serif: "Book Antiqua", "Palatino Linotype", Palatino, "URW Palladio L", P052, Georgia, serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --barra: 56px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 15px/1.5 var(--sans); color: var(--tinta); background: var(--hielo); -webkit-font-smoothing: antialiased; overflow: hidden; }
button { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1 { font-family: var(--serif); font-weight: 700; color: var(--noche); margin: 0; line-height: 1.25; font-size: 27px; }
p { margin: 0; }
.oculto { display: none !important; }
:focus-visible { outline: 3px solid rgba(67, 152, 200, .45); outline-offset: 1px; }

/* ---------- fondo con ondas ---------- */
.fondo { position: fixed; inset: 0; z-index: -1; background: radial-gradient(1200px 700px at 85% -10%, #d9e9f6 0%, transparent 60%), linear-gradient(180deg, #f4f8fb 0%, #e6eef6 100%); pointer-events: none; }
.ondas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ondas path { fill: none; stroke: var(--celeste-claro); stroke-width: 2; opacity: .45; }
.ondas path:nth-child(2) { stroke: var(--celeste); opacity: .25; }
.ondas path:nth-child(3) { stroke: var(--azul); opacity: .15; }

/* ---------- barra del portal (azul noche, para distinguirla de la barra blanca de cada programa) ---------- */
.portal-barra { position: fixed; top: 0; left: 0; right: 0; height: var(--barra); z-index: 20; display: flex; align-items: center; gap: 18px; padding: 0 18px; background: var(--noche); color: #fff; box-shadow: 0 2px 10px rgba(11, 42, 74, .25); }
.portal-marca { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; flex: none; }
.portal-logo-caja { background: #fff; border-radius: 8px; padding: 3px 8px; display: grid; place-items: center; height: 40px; }
.portal-logo { height: 34px; width: auto; mix-blend-mode: multiply; }
.portal-texto { display: flex; flex-direction: column; line-height: 1.15; }
.portal-texto strong { font-family: var(--serif); font-size: 16.5px; }
.portal-texto span { font-size: 11.5px; color: var(--celeste-claro); letter-spacing: .04em; }

.portal-menu { display: flex; align-items: stretch; gap: 4px; height: 100%; margin-left: 10px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.portal-menu::-webkit-scrollbar { display: none; }
.portal-pestana { display: flex; align-items: center; gap: 8px; padding: 0 14px; color: #c9dcec; text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; border-bottom: 3px solid transparent; border-top: 3px solid transparent; transition: color .15s, background .15s; }
.portal-pestana:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.portal-pestana.activa { color: #fff; border-bottom-color: var(--celeste); background: rgba(255, 255, 255, .08); }
.portal-pestana img { width: 18px; height: 18px; filter: brightness(0) invert(1); opacity: .85; }

.portal-acciones { display: flex; gap: 4px; flex: none; }
.portal-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: transparent; color: #c9dcec; cursor: pointer; text-decoration: none; }
.portal-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .15); }

/* ---------- inicio ---------- */
.inicio { position: fixed; inset: var(--barra) 0 0 0; overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: 48px 20px; }
.ventana { position: relative; background: var(--papel); border-radius: var(--radio); box-shadow: var(--sombra); border-top: 4px solid var(--azul); overflow: hidden; animation: subir .28s cubic-bezier(.2, .8, .2, 1); }
.ventana > * { position: relative; z-index: 1; }
@keyframes subir { from { transform: translateY(14px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
/* Logo de Eraikuntza como sello de agua, centrado en la ventana */
.sello::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: url("logo.jpg") center / min(62%, 420px) no-repeat; opacity: .085; mix-blend-mode: multiply; }
.ventana-inicio { width: min(940px, 100%); padding: 52px 56px 40px; text-align: center; margin: auto 0; }
.sobretitulo { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--celeste); font-weight: 600; margin: 0 0 10px; }
.guia { color: var(--tinta-suave); margin: 14px 0 28px; font-size: 15.5px; }
.pie { margin-top: 30px; font-size: 12.5px; color: var(--tinta-suave); letter-spacing: .06em; }

.opciones { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.opcion { text-align: left; display: flex; flex-direction: column; gap: 8px; padding: 22px 22px 20px; border: 1.5px solid var(--borde); border-radius: 12px; background: rgba(255, 255, 255, .82); cursor: pointer; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s, box-shadow .15s; }
.opcion:hover, .opcion:focus-visible { border-color: var(--celeste); transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(0, 102, 158, .55); outline: none; }
.opcion-icono { width: 42px; height: 42px; border-radius: 10px; background: var(--marca-tinte); display: grid; place-items: center; }
.opcion-icono img { width: 22px; height: 22px; }
.opcion-titulo { font-family: var(--serif); font-weight: 700; font-size: 17.5px; color: var(--noche); line-height: 1.3; }
.opcion-desc { font-size: 13.5px; color: var(--tinta-suave); line-height: 1.45; flex: 1; }
.opcion-lugar { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: 4px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #e7f4ed; color: var(--ok); }
.opcion-lugar.oficina { background: var(--alerta-fondo); color: var(--alerta); }
.opcion-lugar svg { width: 13px; height: 13px; }

/* ---------- programas ---------- */
.marcos { position: fixed; inset: var(--barra) 0 0 0; display: none; flex-direction: column; background: var(--hielo); }
.marcos.activo { display: flex; }
.programa { flex: 1; display: none; flex-direction: column; min-height: 0; }
.programa.activo { display: flex; }
.programa iframe { flex: 1; width: 100%; border: 0; background: var(--hielo); }
.aviso { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--alerta-fondo); color: var(--alerta); font-size: 13px; border-bottom: 1px solid #f0e2b8; }
.aviso svg { width: 16px; height: 16px; }
.aviso span { flex: 1; }
.aviso a { color: var(--alerta); font-weight: 600; }
.aviso button { border: 0; background: none; color: var(--alerta); cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.aviso button:hover { background: rgba(138, 90, 0, .1); }

/* Programa que no puede mostrarse dentro del portal: se ofrece abrirlo aparte */
.externo { flex: 1; display: grid; place-items: center; padding: 20px; }
.externo .ventana { width: min(560px, 100%); padding: 40px 36px; text-align: center; }
.externo h2 { font-family: var(--serif); color: var(--noche); margin: 0 0 10px; font-size: 21px; }
.externo p { color: var(--tinta-suave); margin-bottom: 22px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 9px; border: 1.5px solid transparent; cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; background: var(--azul); color: #fff; }
.btn:hover { background: var(--azul-osc); }

.error-carga { padding: 30px; text-align: center; color: #b42318; }

/* ---------- pantallas chicas ---------- */
@media (max-width: 760px) {
  .portal-texto { display: none; }
  .portal-barra { gap: 8px; padding: 0 10px; }
  .portal-menu { margin-left: 0; }
  .portal-pestana { padding: 0 10px; }
  .portal-pestana span { display: none; }
  .portal-pestana img, .portal-pestana svg { width: 20px; height: 20px; }
  .ventana-inicio { padding: 36px 22px 28px; }
  .inicio { padding: 24px 16px; }
  h1 { font-size: 22px; }
}
