:root {
  color-scheme: dark;
  --bg: #0a0f1a;
  --surface: #121a29;
  --surface-raised: #182233;
  --line: rgba(255, 255, 255, .09);
  --text: #eef2f8;
  --muted: #9aa8bd;
  --primary: #5eead4;
  --primary-ink: #06221d;
  --danger: #fda4a4;
  --sans: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(94, 234, 212, .13), transparent 70%),
    radial-gradient(900px 620px at 95% 108%, rgba(59, 130, 246, .16), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

h1 { margin: 0; font-weight: 650; letter-spacing: -.02em; }

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

/* Inloggen */

.page-login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.login {
  width: 100%;
  max-width: 400px;
  padding: 36px 32px 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}

.login-mark { display: block; margin-bottom: 20px; }

.login h1 { font-size: 1.6rem; }

.login-sub { margin: 6px 0 24px; color: var(--muted); }

.login label, .panel label {
  display: block;
  margin: 16px 0 6px;
  font-size: .875rem;
  font-weight: 600;
}

.login input, .panel input {
  width: 100%;
  padding: 12px 14px;
  color: var(--text);
  font: inherit;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}

.login input:focus, .panel input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, .2);
}

.code-input {
  font-family: var(--mono);
  font-size: 1.25rem;
  letter-spacing: .25em;
}

.login button, .panel button, .button {
  display: block;
  width: 100%;
  margin-top: 24px;
  padding: 13px;
  color: var(--primary-ink);
  font: inherit;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  background: var(--primary);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: filter .15s;
}

.login button:hover, .panel button:hover, .button:hover { filter: brightness(1.08); }

.panel .button-secondary {
  color: var(--text);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .18);
}

.panel .button-secondary:hover { filter: none; background: rgba(255, 255, 255, .08); }

.text-link {
  display: block;
  margin-top: 16px;
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
}

.text-link:hover { color: var(--text); }

.error, .notice {
  margin: 0 0 8px;
  padding: 10px 14px;
  font-size: .9rem;
  border-radius: 10px;
}

.error {
  color: var(--danger);
  background: rgba(239, 68, 68, .12);
  border: 1px solid rgba(239, 68, 68, .35);
}

.notice {
  color: var(--primary);
  background: rgba(94, 234, 212, .1);
  border: 1px solid rgba(94, 234, 212, .35);
}

.portal .error, .portal .notice { max-width: 860px; margin-bottom: 20px; }

/* Portaal */

.page-portal { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-weight: 650;
  text-decoration: none;
}

.account { display: flex; align-items: center; gap: 10px; margin: 0; }

.account-name { color: var(--muted); font-size: .9rem; }

.logout {
  padding: 7px 14px;
  color: var(--text);
  font: inherit;
  font-size: .875rem;
  text-decoration: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
}

.logout:hover { background: rgba(255, 255, 255, .08); }

.portal {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(32px, 7vh, 72px) clamp(16px, 4vw, 40px) 48px;
}

.portal h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); overflow-wrap: anywhere; }

.lead { margin: 8px 0 36px; color: var(--muted); font-size: 1.05rem; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.accent-amber { --accent: #ffb300; --accent-soft: rgba(255, 179, 0, .16); }
.accent-violet { --accent: #a970e0; --accent-soft: rgba(145, 110, 225, .2); }
.accent-steel { --accent: #7cc4f0; --accent-soft: rgba(124, 196, 240, .16); }
.accent-ember { --accent: #f4623a; --accent-soft: rgba(244, 98, 58, .17); }

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 26px 24px 20px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  background: linear-gradient(180deg, var(--surface-raised), var(--surface));
  border: 1px solid var(--line);
  border-radius: 20px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  animation: rise .45s ease both;
}

.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(280px 200px at 25% 0%, var(--accent-soft), transparent 75%);
  pointer-events: none;
}

.tile > * { position: relative; }

.tile:hover, .tile:focus-visible {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .4), 0 0 34px var(--accent-soft);
}

.tile:focus-visible { outline-color: var(--accent); }

li:nth-child(2) .tile { animation-delay: .06s; }
li:nth-child(3) .tile { animation-delay: .12s; }
li:nth-child(4) .tile { animation-delay: .18s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
}

.tile-logo {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin-bottom: 22px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.tile-logo img { display: block; width: 60px; height: 60px; object-fit: contain; }

/* Het Spotweb-icoon heeft een eigen zwarte achtergrond en vult daarom het hele vlak. */
.accent-steel .tile-logo { overflow: hidden; background: #000; }
.accent-steel .tile-logo img { width: 100%; height: 100%; }

.tile-name { font-size: 1.35rem; font-weight: 650; letter-spacing: -.01em; }

.tile-desc { margin-top: 4px; color: var(--muted); }

.tile-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 26px;
}

.tile-arrow {
  flex: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease;
}

.tile:hover .tile-arrow, .tile:focus-visible .tile-arrow { transform: translate(2px, -2px); }

/* Account */

.panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 420px));
  gap: 20px;
  align-items: start;
}

.panel {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
}

.panel h2 { margin: 0 0 8px; font-size: 1.2rem; font-weight: 650; }

.panel-text { margin: 0; color: var(--muted); line-height: 1.5; }

.panel-setup {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 36px;
  max-width: 860px;
}

.hint { margin: 6px 0 0; color: var(--muted); font-size: .85rem; }

.status {
  display: inline-block;
  margin: 8px 0 14px;
  padding: 3px 10px;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
  background: rgba(255, 255, 255, .06);
  border-radius: 99px;
}

.status-on { color: var(--primary); background: rgba(94, 234, 212, .12); }

/* Altijd zwart op wit met een witte rand, anders scant niet elke app de code. */
.qr {
  width: 232px;
  max-width: 100%;
  margin: 18px 0;
  padding: 16px;
  background: #fff;
  border-radius: 14px;
}

.qr svg { display: block; width: 100%; height: auto; }

.secret {
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: .85rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

@media (max-width: 560px) {
  .account-name { display: none; }
  .tile { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 16px; padding: 18px; }
  .tile-logo { width: 64px; height: 64px; margin: 0; border-radius: 16px; }
  .tile-logo img { width: 44px; height: 44px; }
  .accent-steel .tile-logo img { width: 100%; height: 100%; }
  .tile-name { flex: 1; min-width: 0; }
  .tile-desc { width: 100%; margin-top: 12px; }
  .tile-foot { width: 100%; padding-top: 10px; }
}

@media (max-width: 420px) {
  .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

@media (prefers-reduced-motion: reduce) {
  .tile { animation: none; transition: none; }
  .tile:hover, .tile:focus-visible { transform: none; }
  .tile-arrow { transition: none; }
}
