/* ISERN UI — disseny compartit del portal (Portal, Repartiment Blanca, Matí per Tarda).
   Aquest fitxer ha de ser IDÈNTIC a Transportblanca/static/isern-ui.css i Matipertarda/static/isern-ui.css. */

:root {
  --isern-primary: #2f86b8;
  --isern-primary-600: #236a95;
  --isern-primary-100: #d3e8f4;
  --isern-primary-50: #eaf4fa;
  --isern-ink: #14202b;
  --isern-muted: #5f6f7d;
  --isern-faint: #97a4b0;
  --isern-line: #e4eaef;
  --isern-bg: #f3f6f9;
  --isern-surface: #ffffff;
  --isern-ok: #1a7f3c;
  --isern-warn: #e07b10;
  --isern-danger: #c5221f;
  --isern-radius: 14px;
  --isern-radius-sm: 10px;
  --isern-shadow: 0 1px 2px rgba(20, 32, 43, .05), 0 4px 16px rgba(20, 32, 43, .06);
  --isern-shadow-hover: 0 2px 4px rgba(20, 32, 43, .06), 0 12px 30px rgba(47, 134, 184, .2);
  --isern-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.isern-auth, .isern-auth *, .isern-portal, .isern-portal *, .isern-launcher, .isern-launcher * { box-sizing: border-box; }

/* ── Icones (sprite inline definit a _isern_launcher.html) ─────────────────── */
.isern-ico {
  width: 20px; height: 20px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Selector d'eines (llançador) ─────────────────────────────────────────── */
.isern-launcher { position: relative; flex-shrink: 0; }
.isern-launcher-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--isern-primary-100);
  background: var(--isern-primary-50); color: var(--isern-primary-600); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, transform .1s, box-shadow .15s;
}
.isern-launcher-btn:hover { background: var(--isern-primary-100); }
.isern-launcher-btn:active { transform: scale(.95); }
.isern-launcher-btn[aria-expanded="true"] { background: var(--isern-primary); color: #fff; border-color: var(--isern-primary); }
.isern-menu {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 1000;
  width: 300px; max-width: calc(100vw - 16px);
  background: var(--isern-surface); border: 1px solid var(--isern-line); border-radius: 16px;
  box-shadow: 0 12px 40px rgba(20, 32, 43, .18); padding: 8px;
  font-family: var(--isern-font); animation: isern-pop .14s ease-out;
}
.isern-menu[hidden] { display: none; }
@keyframes isern-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.isern-menu-title {
  padding: 8px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--isern-faint);
}
.isern-menu-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 11px;
  text-decoration: none; color: var(--isern-ink); transition: background .12s;
}
.isern-menu-item:hover { background: var(--isern-bg); }
.isern-menu-item.is-active { background: var(--isern-primary-50); }
.isern-menu-item .tile {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--isern-primary-50); color: var(--isern-primary-600);
}
.isern-menu-item.is-active .tile { background: var(--isern-primary); color: #fff; }
.isern-menu-item .txt { display: flex; flex-direction: column; min-width: 0; }
.isern-menu-item .nom { font-size: 14px; font-weight: 600; line-height: 1.25; }
.isern-menu-item .desc { font-size: 12px; color: var(--isern-muted); line-height: 1.3; }

/* ── Marca de la barra superior ───────────────────────────────────────────── */
.isern-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--isern-ink); min-width: 0; }
.isern-brand img { height: 28px; width: auto; border-radius: 6px; display: block; flex-shrink: 0; }
.isern-brand .nom { font-size: 15px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.isern-brand .app { font-weight: 500; color: var(--isern-muted); }

/* ── Botons i etiquetes ───────────────────────────────────────────────────── */
.isern-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  font: 600 14px/1.2 var(--isern-font); cursor: pointer; text-decoration: none;
  transition: background .15s, box-shadow .15s, transform .08s;
}
.isern-btn:active { transform: scale(.98); }
.isern-btn--primary { background: var(--isern-primary); color: #fff; box-shadow: 0 1px 2px rgba(35, 106, 149, .3); }
.isern-btn--primary:hover { background: var(--isern-primary-600); }
.isern-btn--block { width: 100%; }
.isern-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--isern-primary-50); color: var(--isern-primary-600);
  font: 600 12px/1.2 var(--isern-font); border: 1px solid var(--isern-primary-100);
}

/* ── Pantalla d'accés (login) ─────────────────────────────────────────────── */
.isern-auth {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  font-family: var(--isern-font); -webkit-font-smoothing: antialiased; color: var(--isern-ink);
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(255, 255, 255, .22), transparent 60%),
    radial-gradient(700px 500px at 100% 110%, rgba(20, 32, 43, .28), transparent 60%),
    linear-gradient(140deg, #3f95c8 0%, #2f86b8 45%, #236a95 100%);
}
.isern-auth-card {
  width: 100%; max-width: 380px; background: var(--isern-surface); border-radius: 20px;
  padding: 32px 30px 26px; box-shadow: 0 24px 60px rgba(10, 30, 45, .35);
}
.isern-auth-logo { display: block; height: 40px; width: auto; margin: 0 auto 18px; border-radius: 8px; }
.isern-auth-title { text-align: center; font-size: 19px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 4px; }
.isern-auth-sub { text-align: center; font-size: 13px; color: var(--isern-muted); margin: 0 0 22px; }
.isern-field-label {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--isern-muted); margin-bottom: 7px;
}
.isern-input {
  width: 100%; padding: 12px 14px; border: 1px solid #d5dde4; border-radius: 11px; background: #fff;
  font: 400 16px var(--isern-font); color: var(--isern-ink); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.isern-input:focus { border-color: var(--isern-primary); box-shadow: 0 0 0 4px rgba(47, 134, 184, .15); }
.isern-auth .isern-btn { margin-top: 16px; }
.isern-error {
  background: #fdeeee; color: var(--isern-danger); border: 1px solid #f6c9c8; border-radius: 10px;
  padding: 9px 12px; font-size: 13px; margin: 0 0 14px; text-align: center;
}
.isern-auth-hint {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--isern-line);
  text-align: center; font-size: 12px; color: var(--isern-faint);
}

/* ── Portal (pàgina d'inici) ──────────────────────────────────────────────── */
.isern-portal { min-height: 100vh; background: var(--isern-bg); font-family: var(--isern-font); color: var(--isern-ink); -webkit-font-smoothing: antialiased; }
.isern-portal-bar {
  display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 20px;
  background: var(--isern-surface); border-bottom: 1px solid var(--isern-line); position: sticky; top: 0; z-index: 50;
}
.isern-portal-main { max-width: 980px; margin: 0 auto; padding: 44px 20px 60px; }
.isern-hero { margin-bottom: 30px; }
.isern-hero h1 { margin: 0 0 6px; font-size: 28px; font-weight: 750; letter-spacing: -.02em; }
.isern-hero p { margin: 0; font-size: 15px; color: var(--isern-muted); }
.isern-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.isern-card {
  display: flex; flex-direction: column; gap: 14px; padding: 22px; text-decoration: none; color: inherit;
  background: var(--isern-surface); border: 1px solid var(--isern-line); border-radius: var(--isern-radius);
  box-shadow: var(--isern-shadow); transition: transform .14s, box-shadow .18s, border-color .18s;
}
.isern-card:hover { transform: translateY(-3px); box-shadow: var(--isern-shadow-hover); border-color: var(--isern-primary-100); }
.isern-card:active { transform: translateY(-1px); }
.isern-card .tile {
  width: 52px; height: 52px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--isern-primary-50), var(--isern-primary-100)); color: var(--isern-primary-600);
}
.isern-card .tile .isern-ico { width: 26px; height: 26px; }
.isern-card h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.isern-card p { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--isern-muted); }
.isern-card .go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--isern-primary-600); }
.isern-card .tag { align-self: flex-start; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #f1f4f7; color: var(--isern-muted); }

@media (max-width: 600px) {
  .isern-menu { position: fixed; top: 64px; left: 8px; right: 8px; width: auto; }
  .isern-brand .app { display: none; }
  .isern-portal-main { padding-top: 28px; }
  .isern-hero h1 { font-size: 24px; }
}
