:root {
  color-scheme: dark;
  --navy-950: #040b13;
  --navy-900: #071525;
  --navy-850: #0a1b2e;
  --navy-800: #10243a;
  --navy-700: #183650;
  --ink: #f5fbff;
  --muted: #9bb0c4;
  --teal: #2dd4bf;
  --teal-soft: #7ee9dc;
  --blue: #5d7df7;
  --danger: #ff758c;
  --line: rgba(160, 194, 218, 0.17);
  --panel: rgba(10, 27, 46, 0.82);
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.36);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--navy-950); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 15%, rgba(45, 212, 191, 0.10), transparent 30rem),
    radial-gradient(circle at 90% 72%, rgba(93, 125, 247, 0.11), transparent 34rem),
    linear-gradient(145deg, #06101c 0%, #071525 52%, #07111d 100%);
}

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

.hidden { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  transform: translateY(-150%);
  border-radius: 10px;
  padding: 10px 14px;
  color: #041216;
  background: var(--teal-soft);
  font-weight: 800;
}

.skip-link:focus { transform: translateY(0); }

.ambient {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(45, 212, 191, 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.ambient::before,
.ambient::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(45, 212, 191, 0.07);
  border-radius: inherit;
  inset: 52px;
}

.ambient::after { inset: 118px; }
.ambient-one { top: 18%; left: -260px; }
.ambient-two { right: -250px; bottom: -140px; width: 520px; height: 520px; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 0 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: #031a20;
  background: linear-gradient(145deg, var(--teal-soft), var(--teal));
  box-shadow: 0 10px 32px rgba(45, 212, 191, 0.22);
  font-size: 18px;
  font-weight: 950;
}

.brand-word { font-size: 24px; font-weight: 900; letter-spacing: -0.04em; }
.brand-word span { color: var(--teal); }

.header-state {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  color: #bdcad8;
  background: rgba(7, 21, 37, 0.66);
  font-size: 12px;
  font-weight: 750;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(45, 212, 191, 0.10);
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(36px, 7vh, 84px) 0 50px;
}

.auth-layout {
  display: grid;
  min-height: min(650px, calc(100vh - 150px));
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: clamp(40px, 7vw, 110px);
  align-items: center;
}

.intro-panel { max-width: 650px; }

.eyebrow,
.panel-kicker {
  margin: 0 0 16px;
  color: var(--teal-soft);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.intro-panel h1,
.dashboard-heading h1 {
  margin: 0;
  color: #f7fbff;
  font-size: clamp(46px, 6.3vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.intro-panel h1 span,
.dashboard-heading h1 span {
  color: transparent;
  background: linear-gradient(100deg, var(--teal-soft), #6dc8ff);
  background-clip: text;
  -webkit-background-clip: text;
}

.lead {
  max-width: 570px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.65;
}

.trust-list {
  display: grid;
  max-width: 590px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.trust-list li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: start;
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.trust-list > li > span { color: var(--teal); font: 800 11px/1.5 ui-monospace, monospace; }
.trust-list strong { display: block; font-size: 14px; }
.trust-list small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }

.panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(16, 36, 58, 0.92), rgba(7, 21, 37, 0.92));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-panel { padding: clamp(26px, 4vw, 42px); }

.loading-panel {
  display: flex;
  min-height: 260px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  color: var(--muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(126, 233, 220, 0.18);
  border-top-color: var(--teal-soft);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.auth-panel h2,
.session-panel h2,
.boundary-panel h2 {
  margin: 0;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.panel-copy { margin: 11px 0 25px; color: var(--muted); font-size: 14px; line-height: 1.55; }

form { display: grid; }

label {
  margin: 15px 0 7px;
  color: #dbe6f0;
  font-size: 12px;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(165, 197, 220, 0.24);
  border-radius: 14px;
  outline: 0;
  padding: 0 15px;
  color: var(--ink);
  background: rgba(3, 12, 22, 0.56);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus {
  border-color: var(--teal);
  background: rgba(3, 12, 22, 0.76);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.12);
}

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0 18px;
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, opacity 160ms ease;
}

.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:focus-visible,
.text-button:focus-visible,
a:focus-visible { outline: 3px solid rgba(126, 233, 220, 0.75); outline-offset: 3px; }
.button:disabled { cursor: wait; opacity: 0.55; transform: none; }
.primary { margin-top: 23px; color: #04171c; background: linear-gradient(120deg, var(--teal-soft), var(--teal)); box-shadow: 0 14px 34px rgba(45, 212, 191, 0.16); }
.secondary { border-color: rgba(173, 205, 226, 0.25); background: rgba(8, 23, 39, 0.66); }
.danger { border-color: rgba(255, 117, 140, 0.36); color: #ffd7de; background: rgba(100, 22, 39, 0.26); }
.compact { min-height: 44px; }

.text-button {
  display: block;
  margin: 19px auto 0;
  border: 0;
  padding: 8px;
  cursor: pointer;
  color: #a9c3ff;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.boundary-note {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  margin-top: 26px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  color: var(--muted);
}

.boundary-note > span { color: var(--teal); font-size: 10px; line-height: 1.8; }
.boundary-note p { margin: 0; font-size: 11px; line-height: 1.55; }
.boundary-note strong { color: #dce8f2; }

.message {
  margin-top: 18px;
  border: 1px solid rgba(126, 233, 220, 0.25);
  border-radius: 12px;
  padding: 12px 13px;
  color: #bdf5ed;
  background: rgba(22, 91, 85, 0.22);
  font-size: 12px;
  line-height: 1.5;
}

.message.error { border-color: rgba(255, 117, 140, 0.32); color: #ffd0d8; background: rgba(95, 18, 34, 0.25); }
.message.inline { margin: 17px 0 0; }

.dashboard { padding-top: 10px; }

.dashboard-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.dashboard-heading h1 { font-size: clamp(36px, 5vw, 60px); }
.dashboard-heading > div > p:last-child { margin: 15px 0 0; color: var(--muted); }

.safety-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 34px;
  border: 1px solid rgba(45, 212, 191, 0.19);
  border-radius: 16px;
  padding: 14px 18px;
  color: #c9eee9;
  background: linear-gradient(90deg, rgba(13, 77, 73, 0.32), rgba(10, 30, 48, 0.45));
}

.safety-ribbon div { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.safety-ribbon p { margin: 0; color: #8fbab8; font-size: 11px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 5px rgba(45, 212, 191, 0.10); }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.metric-card {
  display: grid;
  min-height: 172px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  background: rgba(10, 27, 46, 0.68);
}

.metric-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  color: #b9cbff;
  background: rgba(93, 125, 247, 0.16);
  font-weight: 900;
}

.metric-icon.approved { color: var(--teal-soft); background: rgba(45, 212, 191, 0.13); }
.metric-icon.pending { color: #f0c775; background: rgba(240, 199, 117, 0.13); }
.metric-icon.blocked { color: var(--danger); background: rgba(255, 117, 140, 0.13); }
.metric-card p { align-self: end; margin: 17px 0 5px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.metric-card strong { font-size: 17px; }
.metric-card small { margin-top: 5px; color: #839aae; font-size: 11px; overflow-wrap: anywhere; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
  margin-top: 16px;
}

.session-panel,
.boundary-panel { padding: clamp(23px, 3vw, 32px); }

.card-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.current-pill { border: 1px solid rgba(45, 212, 191, 0.21); border-radius: 999px; padding: 7px 10px; color: var(--teal-soft); background: rgba(45, 212, 191, 0.08); font-size: 10px; font-weight: 850; white-space: nowrap; }

.session-details { display: grid; margin: 25px 0 0; }
.session-details > div { display: grid; grid-template-columns: 135px 1fr; gap: 18px; border-top: 1px solid var(--line); padding: 14px 0; }
.session-details dt { color: var(--muted); font-size: 11px; }
.session-details dd { margin: 0; text-align: right; color: #dce6f0; font-size: 12px; font-weight: 750; overflow-wrap: anywhere; }
.session-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }

.boundary-panel { overflow: hidden; position: relative; }
.boundary-panel h2 { max-width: 300px; }
.boundary-panel ul { display: grid; gap: 10px; margin: 24px 0 0; padding: 0; list-style: none; color: #b8c8d7; font-size: 12px; }
.boundary-panel li { display: flex; gap: 9px; }
.boundary-panel li span { color: var(--teal); font-weight: 900; }

.lock-visual {
  position: absolute;
  top: 35px;
  right: -68px;
  display: grid;
  width: 185px;
  height: 185px;
  place-items: center;
  border: 1px solid rgba(45, 212, 191, 0.10);
  border-radius: 50%;
}

.lock-visual::before,
.lock-visual::after { position: absolute; content: ""; border: 1px solid rgba(45, 212, 191, 0.09); border-radius: inherit; inset: 31px; }
.lock-visual::after { inset: 66px; background: rgba(45, 212, 191, 0.07); }
.lock-visual span { z-index: 1; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 22px var(--teal); }

.dashboard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  margin-top: 26px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  color: #6f879b;
  font-size: 11px;
}

.dashboard-footer p { margin: 0; }
.dashboard-footer nav { display: flex; gap: 19px; }
.dashboard-footer a { color: #9db0c2; text-decoration: none; }
.dashboard-footer a:hover { color: var(--teal-soft); }

@media (max-width: 850px) {
  .auth-layout { min-height: auto; grid-template-columns: 1fr; gap: 36px; }
  .intro-panel { max-width: none; }
  .trust-list { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .site-header,
  .shell { width: min(100% - 28px, 1180px); }
  .site-header { padding-top: max(16px, env(safe-area-inset-top)); }
  .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
  .brand-word { font-size: 21px; }
  .header-state span:last-child { display: none; }
  .header-state { min-width: 36px; min-height: 36px; justify-content: center; padding: 0; }
  .shell { padding-top: 34px; padding-bottom: calc(36px + env(safe-area-inset-bottom)); }
  .intro-panel h1 { font-size: clamp(42px, 13vw, 58px); }
  .lead { margin-top: 18px; font-size: 15px; }
  .auth-layout { gap: 28px; }
  .panel { border-radius: 22px; }
  .auth-panel { padding: 24px 20px; }
  .dashboard-heading { align-items: start; flex-direction: column; }
  .dashboard-heading .button { width: 100%; }
  .safety-ribbon { align-items: start; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card:last-child { grid-column: auto; }
  .metric-card { min-height: 150px; }
  .card-heading { align-items: start; flex-direction: column-reverse; }
  .session-details > div { grid-template-columns: 1fr; gap: 5px; }
  .session-details dd { text-align: left; }
  .session-actions { grid-template-columns: 1fr; }
  .lock-visual { opacity: 0.65; }
  .dashboard-footer { align-items: start; flex-direction: column; }
  .dashboard-footer nav { flex-wrap: wrap; }
}

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