/* Base: reset, type, console components shared by landing and auth. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--ground); }
body {
  margin: 0; min-height: 100vh;
  font-family: var(--font-body); font-size: var(--text-md); line-height: var(--lh-body);
  color: var(--ink); background: var(--ground);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--green); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: var(--green-2); transition: color var(--t-fast), text-decoration-color var(--t-fast); }
a:hover { color: #fff; text-decoration-color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
strong { font-weight: 700; }
small { font-size: var(--text-sm); }
::selection { background: var(--green); color: var(--ground); }
::placeholder { color: var(--ink-3); opacity: 1; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: var(--r-sm); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }
html { caret-color: var(--green); scrollbar-color: var(--bezel-2) var(--ground); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--ground); }
::-webkit-scrollbar-thumb { background: var(--bezel-2); border: 3px solid var(--ground); border-radius: 8px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.d-none { display: none !important; }
.mono { font-family: var(--font-mono); }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link { position: absolute; left: var(--s-4); top: -100px; z-index: 100; padding: var(--s-2) var(--s-4); background: var(--green); color: var(--ground); font-weight: 700; border-radius: var(--r-sm); text-decoration: none; }
.skip-link:focus { top: var(--s-4); }

/* ---------- Sky: sparse stars on the flat ground behind the consoles (landing + auth; assets/js/sky.js) ---------- */
.sky { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity 1.2s var(--ease-out); }
.sky.is-on { opacity: 1; }
.sb-landing main, .sb-auth main, .sb-landing .foot, .sb-auth .foot { position: relative; z-index: 1; }

/* ---------- Bezel (site header) ---------- */
.bezel { position: sticky; top: 0; z-index: 50; background: rgba(10, 15, 20, 0.92); border-bottom: var(--line); backdrop-filter: blur(6px); }
.bezel__row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 64px; }
.lockup { display: inline-flex; align-items: center; gap: var(--s-3); color: var(--ink); text-decoration: none; }
.lockup__img { height: 40px; width: auto; }
.lockup:hover .lockup__img { filter: brightness(1.08); }

/* ---------- Modules ---------- */
.mod { background: var(--panel); border: var(--line); border-radius: var(--r); }
.mod__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: var(--line); min-height: 44px; }
.mod__label { font-family: var(--font-label); font-size: var(--text-xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); font-weight: 400; margin: 0; }
.mod__tag { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-2); letter-spacing: 0.04em; white-space: nowrap; }
.mod__body { padding: var(--s-4); }
.mod--unlit { border-style: dashed; background: transparent; }
@media (min-width: 720px) { .mod__body { padding: var(--s-5); } }

/* ---------- Lamps ---------- */
.lamp { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--bezel-2); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35); flex: none; transition: background var(--t-med), box-shadow var(--t-med); }
.lamp--on { background: var(--green); box-shadow: 0 0 0 2px rgba(0,227,140,0.12), 0 0 10px var(--green-glow); }
.lamp--amber { background: var(--amber); box-shadow: 0 0 0 2px rgba(242,201,76,0.12), 0 0 10px var(--amber-glow); }
.lamp--orange { background: var(--orange); box-shadow: 0 0 10px var(--orange-glow); }
.lamp-link { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-2); color: var(--ink); text-decoration: none; font-size: var(--text-sm); letter-spacing: 0.02em; }
.lamp-link:hover { color: #fff; }
.lamp-link:hover .lamp { background: var(--green-2); }
.lamp-link--go { color: var(--green); }

/* ---------- Buttons ---------- */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 48px; padding: 0 var(--s-5); border-radius: var(--r-sm); font-weight: 700; font-size: var(--text-sm); letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; transition: transform var(--t-fast) var(--ease-out), background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }
/* The guarded switch: the one orange control. A hinged cover line sits above it. */
.btn--switch { background: var(--orange); color: #14080A; box-shadow: 0 0 0 1px var(--orange-2), 0 0 18px var(--orange-glow); margin-top: 10px; }
.btn--switch::before { content: ""; position: absolute; left: 6px; right: 6px; top: -10px; height: 4px; border-radius: 2px; background: var(--orange-2); }
.btn--switch:hover { background: #FF8F4C; box-shadow: 0 0 0 1px var(--orange-2), 0 0 26px var(--orange-glow); }
.btn--ghost { background: transparent; color: var(--green); box-shadow: inset 0 0 0 1px var(--bezel-2); }
.btn--ghost:hover { color: #fff; box-shadow: inset 0 0 0 1px var(--green); }
.btn--link { min-height: 44px; padding: 0 var(--s-2); color: var(--ink-2); text-transform: none; letter-spacing: 0; font-weight: 400; text-decoration: underline; text-underline-offset: 0.2em; }
.btn--link:hover { color: #fff; }
.btn--block { width: 100%; }
.btn-loading { color: transparent !important; pointer-events: none; }
.btn-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(20,8,10,0.35); border-top-color: #14080A; animation: sb-spin 0.8s linear infinite; }
.btn--ghost.btn-loading::after { border-color: rgba(0,227,140,0.3); border-top-color: var(--green); }
@keyframes sb-spin { to { transform: rotate(360deg); } }

/* ---------- Fields: recessed console cells ---------- */
.field { display: grid; gap: var(--s-2); margin-bottom: var(--s-4); }
.field__label { font-family: var(--font-label); font-size: var(--text-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); }
.field__hint { font-size: var(--text-sm); color: var(--ink-2); }
.cell { width: 100%; min-height: 48px; padding: var(--s-3) var(--s-4); background: var(--panel-2); border: 1px solid var(--bezel-2); border-radius: var(--r-sm); color: var(--ink); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.cell:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(0,227,140,0.15); outline: none; }
.cell:user-invalid { border-color: var(--amber); }
select.cell { appearance: none; -webkit-appearance: none; padding-right: 2.5rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%238FA3B5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.9rem center; background-size: 18px; }
.pw-wrap { position: relative; }
.pw-wrap .cell { padding-right: 3.2rem; }
.pw-toggle { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); border-radius: var(--r-sm); }
.pw-toggle:hover { color: var(--green); }
.pw-toggle svg { width: 20px; height: 20px; }
.pw-toggle .pw-toggle__off, .pw-toggle[aria-pressed="true"] .pw-toggle__on { display: none; }
.pw-toggle[aria-pressed="true"] .pw-toggle__off { display: block; }

/* Checkbox as a lamp switch */
.check { display: flex; align-items: center; gap: var(--s-3); min-height: 44px; cursor: pointer; font-size: var(--text-sm); }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__lamp { width: 18px; height: 18px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--bezel-2); flex: none; transition: background var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast); }
.check input:checked + .check__lamp { background: var(--green); border-color: var(--green); box-shadow: 0 0 10px var(--green-glow); }
.check input:focus-visible + .check__lamp { outline: 2px solid var(--green); outline-offset: 3px; }

/* ---------- Alerts (markup injected by assets/js/process.js) ---------- */
.alert-message-reponse:empty { display: none; }
.alert-message-reponse .alert { display: flex; align-items: flex-start; gap: var(--s-3); margin: var(--s-4) 0 0; padding: var(--s-3) var(--s-4); border: 1px solid var(--bezel-2); border-radius: var(--r-sm); background: var(--panel-2); font-size: var(--text-sm); }
.alert-message-reponse .alert::before { content: ""; width: 10px; height: 10px; border-radius: 50%; margin-top: 0.4em; flex: none; background: var(--amber); box-shadow: 0 0 10px var(--amber-glow); }
.alert-message-reponse .alert-success { border-color: var(--green-2); color: var(--ink); }
.alert-message-reponse .alert-success::before { background: var(--green); box-shadow: 0 0 10px var(--green-glow); }
.alert-message-reponse .alert-warning, .alert-message-reponse .alert-danger, .alert-message-reponse .alert-error { border-color: #5a4a1a; }
.alert-message-reponse .icon-symbol { display: none; }

/* ---------- Mono separators + service-name tokens (landing anatomy, panel tables) ---------- */
.sep { display: inline-block; width: 0.38em; text-align: center; letter-spacing: 0; }
.tok { display: inline-block; padding: 0 0.4em 0 0.25em; border-radius: var(--r-sm); border: 1px solid var(--bezel-2); margin: 0.15em 0.1em; }
.tok--type { border-color: var(--green); color: var(--green); }
.tok--start { border-color: #5FA8FF; color: #9CC9FF; }
.tok--speed { border-color: var(--amber); color: var(--amber); }
.tok--max { border-color: #B79CFF; color: #C9B8FF; }
.tok--tag { border-color: var(--ink-2); color: var(--ink-2); }

/* ---------- Prose from admin HTML options ---------- */
.prose p { margin: 0 0 var(--s-3); }
.prose p:last-child { margin-bottom: 0; }
.prose ul { list-style: disc; padding-left: 1.2em; margin-bottom: var(--s-3); }

/* ---------- Notice dialog ---------- */
.notice { border: 0; padding: 0; background: transparent; max-width: min(92vw, 560px); }
.notice::backdrop { background: rgba(10, 15, 20, 0.8); }
.notice__body { padding: var(--s-4); }
.notice__actions { padding: 0 var(--s-4) var(--s-4); display: flex; justify-content: flex-end; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
