:root{
  --bg-dark:#0c0f14;
  --tile:#121722;
  --tile-hover:#1a2130;
  --text:#e8ecf1;
  --muted:#9fb0c3;
  --accent:#2fbf71;
  --accent-2:#c1121f;
  --accent-3:#ffbf00;
  --radius:20px;
  --shadow:0 10px 30px rgba(0,0,0,.35);
  --container-max:1100px;
}

/* Reset & base */
*{box-sizing:border-box}
html,body{height:100%;margin:0;font-family:system-ui,Segoe UI,Roboto,Arial,sans-serif}

/* ---------- Login page ---------- */
/* apply only on login pages */
body.login{
  background: var(--bg-dark);
  color: var(--text);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  min-height:100vh;
}

.login-box{
  width:360px;
  padding:28px;
  border-radius:12px;
  background:var(--tile);
  box-shadow:var(--shadow);
}
.login-box h1{margin:0 0 16px;text-align:center}
.login-box label{display:block;color:var(--muted);font-size:13px;margin-top:12px}
.login-box input{width:100%;padding:10px;border-radius:8px;border:none;margin-top:6px;background:#1f2634;color:var(--text)}
.login-box button{width:100%;margin-top:18px;padding:10px;border-radius:8px;border:none;background:linear-gradient(90deg,var(--accent),#ffd27a);font-weight:700;cursor:pointer}
.login-box .error{margin-top:12px;color:#ff9b9b;text-align:center}
.login-box .note{margin-top:8px;color:var(--muted);font-size:13px;text-align:center}

/* ---------- Portal / pujolinet page ---------- */
body.portal{
  background: #000;
  background-image: none;
  color: var(--text);
}

/* Header */
header{
  max-width:var(--container-max);
  margin:48px auto 24px;
  padding:0 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.brand{display:flex;align-items:center;gap:14px}
.crest{
  width:42px;height:42px;border-radius:10px;
  background:conic-gradient(from 0deg, var(--accent) 0 33%, var(--accent-2) 33% 66%, var(--accent-3) 66% 100%);
  box-shadow: inset 0 0 0 4px rgba(0,0,0,.25), var(--shadow);
}
h1{font-size:clamp(20px,3vw,28px);margin:0}
.subtitle{color:var(--muted);font-size:14px}

/* logout button */
.logout-btn{
  display:inline-block;padding:8px 12px;
  background:linear-gradient(180deg,#ff6b6b,#e04141);
  color:#fff;border-radius:8px;text-decoration:none;font-weight:600;border:1px solid rgba(255,255,255,0.06);
}
.logout-btn:hover{opacity:0.95;transform:translateY(-1px)}

/* Tiles grid */
.grid{
  max-width:var(--container-max);
  margin:12px auto 60px;
  padding:0 20px;
  display:grid;
  gap:18px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
a.tile{
  display:block;position:relative;overflow:hidden;border-radius:var(--radius);
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0) 30%), var(--tile);
  box-shadow: var(--shadow); text-decoration:none; color:inherit;
  transition: transform .18s ease, background .2s ease, box-shadow .2s ease;
  outline:none;border:1px solid rgba(255,255,255,.06);
}
a.tile:focus-visible{ box-shadow: 0 0 0 3px rgba(47,191,113,.6), var(--shadow); }
a.tile:hover{ transform: translateY(-4px); background: var(--tile-hover); }
.thumb{ aspect-ratio:16/9; display:grid; place-items:center; background: linear-gradient(135deg, rgba(47,191,113,.15), rgba(193,18,31,.10)); }
.thumb svg{ width:64px; height:64px; filter: drop-shadow(0 4px 12px rgba(0,0,0,.4)); }
.content{ padding:16px 16px 18px; }
.title{ font-weight:650; letter-spacing:.2px; }
.desc{ color:rgba(255,255,255,0.8); font-size:14px; margin-top:6px; min-height:2lh; }

/* Footer */
footer{ max-width:var(--container-max); margin:0 auto 40px; padding:0 20px; color:var(--muted); font-size:13px }

/* Accessibility helper */
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

/* ---------- small utilities ---------- */
.container{max-width:var(--container-max);margin:0 auto;padding:0 16px}

/* Iframe embed helper (if used) */
.embed-container{ width:100%; max-width:1200px; margin:18px auto; padding:0 16px; box-sizing:border-box; }
.embed-frame{ width:100%; height:calc(100vh - 240px); border:0; border-radius:8px; box-shadow:0 8px 24px rgba(0,0,0,0.08); background:#fff; }

/* Responsive tweaks */
@media (max-width:800px){
  .embed-frame{ height:calc(100vh - 300px); }
  header{margin:20px auto 16px;}
  .grid{grid-template-columns: 1fr 1fr;}
}
@media (max-width:560px){
  .grid{grid-template-columns: 1fr;}
  header{flex-direction:column;align-items:flex-start;gap:12px}
}

.logo-img {
  height:46px;
  width:auto;
  display:block;
  border-radius:6px;
  object-fit:cover;
}