/* HN Group VPN — vpn.hngroup.org.uk, in the HN Group staff design. */
@font-face { font-family: "Plus Jakarta Sans"; src: url("/assets/fonts/plus-jakarta-sans.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
:root {
  --pink: #E97DE8; --purple: #5514B4; --yellow: #E3E65B; --teal: #3E9BA3; --plum: #7A1F6C; --raspberry: #C2306B; --green: #5FAE7B; --navy: #1C2135;
  --bg: #F6F4FA; --surface: #FFFFFF; --surface-2: #F8F7FB; --text: #1B1A21; --muted: #5E6070; --border: #E2DDEB; --border-strong: #C9C1D8;
  --link: #5514B4; --accent-soft: #EEE6FA; --success: #2E7D4F; --success-soft: #E3F3E9; --danger: #B4234F;
  --shadow: 0 1px 2px rgba(28,33,53,.05), 0 8px 28px rgba(28,33,53,.07); --radius: 20px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0E1020; --surface: #161A2E; --surface-2: #1C2138; --text: #ECEBF4; --muted: #A4A7BA; --border: #2A2F4A; --border-strong: #3A4062;
    --link: #B794F6; --accent-soft: #2A2350; --success: #7CD3A0; --success-soft: #16332A; --danger: #F28AA8; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.3); }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); } .small { font-size: .875rem; }
.on-dark { display: none; }
@media (prefers-color-scheme: dark) { .on-light { display: none; } .on-dark { display: inline; } }

/* Header */
.top { background: var(--surface); position: sticky; top: 0; z-index: 5; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); }
.brand img { height: 36px; width: auto; }
.brand-name { font-weight: 800; font-size: 1.15rem; padding-left: 14px; border-left: 1px solid var(--border-strong); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.who { font-weight: 700; }
@media (max-width: 560px) { .who { display: none; } }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: #fff; background: linear-gradient(135deg, var(--purple), var(--pink)); }
.stripe { display: flex; height: 5px; }
.stripe i:nth-child(1) { background: var(--pink); flex: 14; } .stripe i:nth-child(2) { background: var(--purple); flex: 14; } .stripe i:nth-child(3) { background: var(--yellow); flex: 6; } .stripe i:nth-child(4) { background: var(--teal); flex: 20; }
.stripe i:nth-child(5) { background: var(--plum); flex: 10; } .stripe i:nth-child(6) { background: var(--raspberry); flex: 10; } .stripe i:nth-child(7) { background: var(--green); flex: 13; } .stripe i:nth-child(8) { background: var(--navy); flex: 13; }

main { flex: 1; padding: 40px 0 56px; }
h1 { font-size: clamp(2rem, 4vw, 2.6rem); line-height: 1.12; margin: 0 0 12px; letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: 1.2rem; margin: 0 0 10px; font-weight: 800; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .75rem; font-weight: 800; color: var(--link); margin: 0 0 10px; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 34em; margin: 0 0 24px; }

/* Signed out */
.landing { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding-top: 24px; }
.landing-copy { animation: rise .45s ease both; }
.landing-art { position: relative; height: 340px; display: grid; place-items: center; animation: rise .55s .08s ease both; }
.shield { position: relative; width: 190px; height: 220px; display: grid; place-items: center; z-index: 1; filter: drop-shadow(0 22px 40px rgba(85,20,180,.35)); }
.shield svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.shield path { fill: url(#none); fill: var(--purple); }
.shield span { position: relative; color: #fff; font-size: 3rem; font-weight: 800; letter-spacing: -.02em; margin-top: -10px; }
.orbit { position: absolute; border-radius: 50%; border: 2px dashed var(--border-strong); }
.orbit.o1 { width: 290px; height: 290px; animation: spin 40s linear infinite; }
.orbit.o2 { width: 360px; height: 360px; border-color: var(--accent-soft); border-style: solid; }
.orbit.o1::before, .orbit.o1::after { content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%; }
.orbit.o1::before { top: 18px; left: 40px; background: var(--teal); }
.orbit.o1::after { bottom: 30px; right: 26px; background: var(--pink); }
.features { grid-column: 1 / -1; list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.features li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); display: grid; gap: 4px; animation: rise .5s ease both; }
.features li:nth-child(2) { animation-delay: .06s; } .features li:nth-child(3) { animation-delay: .12s; }
.features span { color: var(--muted); font-size: .92rem; }
@media (max-width: 820px) { .landing { grid-template-columns: 1fr; } .landing-art { height: 260px; order: -1; } .orbit.o2 { width: 280px; height: 280px; } .orbit.o1 { width: 230px; height: 230px; } .features { grid-template-columns: 1fr; } }

/* Signed in */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 26px; animation: rise .4s ease both; }
.hero p { margin: 0; max-width: 36em; }
.stats { display: flex; gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 18px; min-width: 120px; box-shadow: var(--shadow); }
.stat strong { display: block; font-size: 1.8rem; line-height: 1.1; font-weight: 800; }
.stat:last-child strong { color: var(--success); }
.stat span { color: var(--muted); font-size: .85rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; margin-bottom: 20px; animation: rise .4s ease both; }
.card.highlight { border-color: var(--purple); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.grid .card { margin-bottom: 0; }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }
.feature-card { display: flex; flex-direction: column; }
.feature-card p { margin: 0 0 14px; }
.app-icon { width: 72px; height: 72px; margin-bottom: 14px; filter: drop-shadow(0 8px 16px rgba(85,20,180,.25)); }
.icon-tile { width: 72px; height: 72px; border-radius: 18px; background: var(--accent-soft); display: grid; place-items: center; margin-bottom: 14px; }
.icon-tile svg { width: 34px; height: 34px; fill: none; stroke: var(--link); stroke-width: 1.8; stroke-linecap: round; }
.steps { margin: 0 0 16px; padding-left: 20px; color: var(--muted); }
.steps li { margin-bottom: 6px; } .steps strong { color: var(--text); }
.pill { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.pill-accent { background: var(--accent-soft); color: var(--link); border-color: transparent; }

/* Forms and buttons */
.form { display: grid; gap: 12px; }
.form.inline { grid-template-columns: 1fr auto; align-items: center; margin-top: auto; }
@media (max-width: 520px) { .form.inline { grid-template-columns: 1fr; } }
input:not([type=file]) { font: inherit; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface-2); color: var(--text); transition: border-color .15s, box-shadow .15s; width: 100%; }
input:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 4px var(--accent-soft); }
input[type=file] { font: inherit; font-size: .9rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; padding: 12px 20px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, transform .1s, box-shadow .15s, opacity .15s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--purple); color: #fff; box-shadow: 0 6px 16px rgba(85,20,180,.25); }
.btn-primary:hover:not(:disabled) { background: #46109a; box-shadow: 0 8px 22px rgba(85,20,180,.33); }
.btn-large { padding: 15px 28px; font-size: 1.05rem; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-small { padding: 7px 14px; font-size: .85rem; }
.error { color: var(--danger); font-weight: 600; margin: 10px 0 0; }

/* Devices */
.devices { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.device { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-2); transition: border-color .15s, transform .15s; }
.device:hover { border-color: var(--border-strong); }
.device-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); }
.device-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.device.is-on .device-icon { background: var(--success-soft); border-color: transparent; }
.device.is-on .device-icon svg { stroke: var(--success); }
.device-main { display: grid; min-width: 0; }
.device-main strong { overflow-wrap: anywhere; }
.status { font-size: .8rem; font-weight: 700; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); white-space: nowrap; }
.status.on { color: var(--success); background: var(--success-soft); border-color: transparent; }
.status.on::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 6px; vertical-align: 1px; animation: blink 2s ease-in-out infinite; }
@media (max-width: 600px) { .device { grid-template-columns: auto 1fr; } .device .status, .device .btn { grid-column: 2; justify-self: start; } }
.empty { display: grid; gap: 2px; text-align: center; padding: 28px 10px; border: 1px dashed var(--border-strong); border-radius: 16px; color: var(--muted); }
.empty strong { color: var(--text); }
.config { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; font-size: .82rem; overflow-x: auto; white-space: pre; }
details summary { cursor: pointer; color: var(--link); font-weight: 600; }
.admin-app { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.admin-app .form { margin-top: 10px; }

.loading { text-align: center; color: var(--muted); padding: 80px 0; display: flex; justify-content: center; align-items: center; gap: 10px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--purple); animation: spin .8s linear infinite; }
.foot { color: var(--muted); font-size: .85rem; border-top: 1px solid var(--border); background: var(--surface); }
.foot-inner { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; z-index: 10; animation: rise .25s ease both; }

/* Sign-in result pages */
.card.narrow { max-width: 480px; margin: 30px auto; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Profile pictures, the profile page and app versions */
.avatar { overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.me-link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid transparent; transition: background .15s, border-color .15s; }
.me-link:hover, .me-link[aria-current="page"] { background: var(--accent-soft); border-color: var(--border); }
.me-link .who { order: -1; padding-left: 8px; }
.avatar-large { width: 96px; height: 96px; font-size: 2rem; box-shadow: 0 0 0 5px var(--surface), 0 0 0 7px var(--accent-soft), var(--shadow); }
.back { margin: 28px 0 0; } .back a { text-decoration: none; font-weight: 700; }
.profile-hero { display: flex; align-items: center; gap: 28px; margin: 22px 0 18px; animation: rise .4s ease both; }
.profile-hero h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.15; }
.profile-hero .muted { margin: 4px 0 10px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.pill-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.row .device-icon { width: 38px; height: 38px; }
.row-main { display: grid; min-width: 0; } .row-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 12px 1fr auto; gap: 14px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--border); }
.timeline li:last-child { border-bottom: 0; }
.timeline li::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--purple); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline time { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.version { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: -4px 0 6px; font-size: .85rem; color: var(--muted); }
.version strong { color: var(--text); }
@media (max-width: 560px) {
  .profile-hero { flex-direction: column; align-items: flex-start; gap: 18px; }
  .row { grid-template-columns: auto 1fr; } .row > :nth-child(3) { grid-column: 2; justify-self: start; }
  .timeline li { grid-template-columns: 12px 1fr; } .timeline time { grid-column: 2; }
}
