:root {
  --bg: #f3f7f8;
  --tint: #e8f8f8;
  --panel: #ffffff;
  --panel-2: #f6f9fa;
  --text: #1f2430;
  --muted: #5b6472;
  --line: #e2e8ea;
  --brand: #2b6b7f;      /* dark teal — "Lab" */
  --brand-bright: #2bc8e2; /* cyan — "Lrn" / flask */
  --accent: #48a6a7;
  --ok: #1f9d63;
  --danger: #d64545;
  --radius: 16px;
  --shadow: 0 12px 40px rgba(43, 107, 127, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 50% -8%, var(--tint), transparent 60%),
    var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brandhead {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 52px 0 6px;
}
.logo { width: 168px; height: auto; display: block; }
.portal-label {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--brand);
  opacity: 0.75;
}

.card {
  width: min(440px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
  margin-top: 18px;
}

h1 { font-size: 20px; margin: 0 0 6px; color: var(--text); }
.lede { color: var(--muted); font-size: 14px; margin: 0 0 20px; line-height: 1.5; }

label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; color: var(--muted); }

input[type="email"], input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(72, 166, 167, 0.15); }
input.code { letter-spacing: 8px; text-align: center; font-size: 22px; font-weight: 700; }

button {
  width: 100%;
  margin-top: 16px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-bright), var(--brand));
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.05s, opacity 0.15s, box-shadow 0.15s;
  box-shadow: 0 6px 18px rgba(43, 107, 127, 0.22);
}
button:hover { box-shadow: 0 8px 22px rgba(43, 107, 127, 0.28); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: default; box-shadow: none; }
button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  margin-top: 10px;
  box-shadow: none;
}
button.ghost:hover { border-color: var(--accent); color: var(--brand); }

.msg { margin-top: 14px; font-size: 13.5px; line-height: 1.5; min-height: 18px; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }
.hint { margin-top: 18px; font-size: 12.5px; color: var(--muted); }
.hidden { display: none !important; }

/* Hub */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }
.app-tile {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.app-tile:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(43, 107, 127, 0.1); }
.app-tile .t { font-weight: 700; font-size: 15px; color: var(--brand); }
.app-tile .d { color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.4; }
.topbar {
  width: min(440px, calc(100vw - 32px));
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px;
}
.who { font-size: 13px; color: var(--muted); }
.link-btn { background: none; border: none; color: var(--brand); font-weight: 600; width: auto; margin: 0; padding: 0; cursor: pointer; font-size: 13px; box-shadow: none; }
.link-btn:hover { color: var(--brand-bright); box-shadow: none; }
.empty { text-align: center; color: var(--muted); font-size: 14px; line-height: 1.6; padding: 12px 4px; }
.spinner { text-align: center; color: var(--muted); padding: 24px; font-size: 14px; }
