/* mailliz portal. One stylesheet, no scripts; light and dark follow the device. */
:root {
  color-scheme: light dark;
  --bg: #f6f5f2;
  --surface: #ffffff;
  --field: #ffffff;
  --text: #1b1a17;
  --muted: #68645c;
  --line: #e3e0d9;
  --line-strong: #cfcbc2;
  --accent: #3d55cc;
  --ok: #2b8a3e;
  --bad: #c92a2a;
  --alert-bg: #fdecec;
  --alert-line: #f3c2c2;
  --alert-text: #8f1d1d;
  --shadow: rgba(27, 26, 23, .28);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1113;
    --surface: #171a1d;
    --field: #101214;
    --text: #ecebe7;
    --muted: #a09c93;
    --line: #272b30;
    --line-strong: #3a3f46;
    --accent: #93a5ff;
    --ok: #51cf66;
    --bad: #ff6b6b;
    --alert-bg: #2a1616;
    --alert-line: #5a2626;
    --alert-text: #ffb3b3;
    --shadow: rgba(0, 0, 0, .6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1 { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -.02em; }
p { margin: 0; }
.sub { margin-top: 6px; color: var(--muted); font-size: 15px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* brand */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.mark {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--text); color: var(--bg);
  font-weight: 700; font-size: 18px; line-height: 1; padding-bottom: 2px;
}
.word { font-weight: 650; font-size: 18px; letter-spacing: -.02em; }

/* sign-in and message pages */
.auth {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 24px; padding: 32px 16px 64px;
}
.card {
  width: 100%; max-width: 380px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 40px -30px var(--shadow);
}
.card h1 { font-size: 22px; }
label { display: block; margin: 18px 0 6px; font-size: 14px; font-weight: 550; }
input[type="password"], input[type="text"] {
  display: block; width: 100%; height: 46px; padding: 0 13px;
  font: inherit; color: var(--text);
  background: var(--field);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}
input:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input::placeholder { color: var(--muted); opacity: .55; }
.otp { font-variant-numeric: tabular-nums; letter-spacing: .28em; font-size: 18px; }
button { font: inherit; cursor: pointer; }
.primary {
  display: block; width: 100%; height: 46px; margin-top: 24px;
  border: 0; border-radius: 10px;
  background: var(--text); color: var(--bg);
  font-weight: 600;
}
.primary:hover { opacity: .88; }
.alert {
  margin-top: 16px; padding: 10px 13px;
  background: var(--alert-bg); border: 1px solid var(--alert-line); border-radius: 10px;
  color: var(--alert-text); font-size: 14px; overflow-wrap: anywhere;
}
.code {
  font: 13.5px/1.5 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}
p.code { margin-top: 14px; padding: 10px 13px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.link { display: inline-block; margin-top: 18px; color: var(--accent); }

/* start page */
.top {
  max-width: 1040px; margin: 0 auto; padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.ghost {
  height: 38px; padding: 0 14px;
  background: transparent; color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 10px;
  font-size: 14px; font-weight: 550;
}
.ghost:hover { background: var(--surface); }
.home { max-width: 1040px; margin: 0 auto; padding: 32px 24px 72px; }
.grid {
  list-style: none; margin: 28px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px;
}
.grid > li { display: flex; }
.app {
  flex: 1; display: flex; align-items: flex-start; gap: 14px;
  padding: 18px;
  background: var(--surface); color: inherit; text-decoration: none;
  border: 1px solid var(--line); border-radius: 16px;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.app:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 16px 30px -24px var(--shadow); }
.tile {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 650; font-size: 19px;
}
.body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.name { font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.host { font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; color: var(--muted); overflow-wrap: anywhere; }
.desc { margin-top: 8px; font-size: 14px; color: var(--muted); }
.status { margin-top: 12px; display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 550; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.up .dot { background: var(--ok); }
.status.down { color: var(--bad); }
.status.down .dot { background: var(--bad); }
.go { flex: none; color: var(--muted); font-size: 18px; line-height: 1.4; transition: transform .15s ease, color .15s ease; }
.app:hover .go { color: var(--accent); transform: translateX(3px); }
.empty { margin-top: 28px; color: var(--muted); }

.tone-0 .tile { background: #e6ebff; color: #3347b0; }
.tone-1 .tile { background: #e1f3e8; color: #1f7a44; }
.tone-2 .tile { background: #fdebd6; color: #a3520c; }
.tone-3 .tile { background: #f5e3f2; color: #8c2e81; }
.tone-4 .tile { background: #ddf2f5; color: #0f6b7a; }
.tone-5 .tile { background: #fbe3e3; color: #a12b2b; }
@media (prefers-color-scheme: dark) {
  .tone-0 .tile { background: #232b52; color: #aebaff; }
  .tone-1 .tile { background: #173524; color: #8ce0a8; }
  .tone-2 .tile { background: #3d2a12; color: #ffc078; }
  .tone-3 .tile { background: #3a1d36; color: #f0a8e6; }
  .tone-4 .tile { background: #12343a; color: #8fdbe8; }
  .tone-5 .tile { background: #401c1c; color: #ffa8a8; }
}

@media (max-width: 520px) {
  .top { padding: 16px; }
  .home { padding: 20px 16px 56px; }
  .grid { grid-template-columns: 1fr; }
  .card { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .app, .go { transition: none; }
  .app:hover { transform: none; }
}

/* "Already signed in on the portal?" under a program's sign-in form */
.handoff { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.handoff .link { margin-top: 0; }
