:root {
  color-scheme: dark;
  --bg: #071019;
  --panel: #0d1822;
  --panel-2: #111f2b;
  --line: #233544;
  --text: #e9f2f5;
  --muted: #8fa5b3;
  --accent: #26d3b2;
  --accent-strong: #12b99a;
  --danger: #ff6f7d;
  --success: #43d18b;
  --shadow: 0 24px 70px rgba(0, 0, 0, .32);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

.login-page {
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 18% 16%, rgba(38, 211, 178, .13), transparent 32rem),
    radial-gradient(circle at 80% 88%, rgba(52, 118, 255, .10), transparent 32rem),
    var(--bg);
}

.login-shell {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.brand-panel {
  min-height: 620px;
  padding: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(145deg, rgba(38, 211, 178, .10), transparent 55%),
    #09141e;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 34px;
  border-radius: 18px;
  background: var(--accent);
  color: #03130f;
  font-weight: 900;
  letter-spacing: -.06em;
  box-shadow: 0 14px 36px rgba(38, 211, 178, .2);
}

.brand-mark-small { width: 42px; height: 42px; margin: 0; border-radius: 12px; font-size: 14px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; }
h1, h2 { margin: 0; letter-spacing: -.035em; }
h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.02; }
h2 { font-size: 22px; }
.lead { max-width: 550px; margin: 22px 0 0; color: #b8c8d1; font-size: 19px; line-height: 1.65; }
.muted { margin: 8px 0 0; color: var(--muted); line-height: 1.55; }

.protocol-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 46px; }
.protocol-row span, .secure-badge, .service-status, .user-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: #adc0ca;
  font-size: 12px;
  font-weight: 700;
}

.login-card {
  padding: 62px 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  background: var(--panel);
}

.form-stack, .settings-form { display: grid; gap: 18px; }
label { display: grid; gap: 8px; color: #c9d8de; font-size: 13px; font-weight: 700; }
label span em { margin-left: 6px; color: var(--success); font-style: normal; font-size: 11px; text-transform: uppercase; }
label small { color: var(--muted); font-weight: 500; line-height: 1.4; }
label code { color: var(--accent); }

input, textarea {
  width: 100%;
  border: 1px solid #2a3d4c;
  border-radius: 11px;
  outline: 0;
  background: #09141d;
  color: var(--text);
  padding: 13px 14px;
  transition: border-color .16s, box-shadow .16s;
}

textarea { resize: vertical; min-height: 150px; font-family: "SFMono-Regular", Consolas, monospace; line-height: 1.55; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(38, 211, 178, .12); }
input::placeholder, textarea::placeholder { color: #617684; }

.button {
  border: 0;
  border-radius: 10px;
  padding: 12px 17px;
  cursor: pointer;
  font-weight: 800;
  transition: transform .14s, background .14s;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--accent); color: #03140f; }
.button-primary:hover { background: var(--accent-strong); }
.button-secondary { background: #1b3040; color: #d8e7ec; border: 1px solid #2b4557; }
.button-ghost { padding: 9px 12px; background: transparent; color: var(--muted); border: 1px solid var(--line); }
.security-note { margin: 0; color: #708693; font-size: 12px; text-align: center; }

.alert { padding: 13px 15px; border-radius: 11px; font-size: 13px; line-height: 1.45; }
.alert-error { border: 1px solid rgba(255, 111, 125, .4); background: rgba(255, 111, 125, .1); color: #ffb4bb; }
.alert-success { border: 1px solid rgba(67, 209, 139, .4); background: rgba(67, 209, 139, .1); color: #9aebc2; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 25, .92);
  backdrop-filter: blur(16px);
}

.brand, .topbar-actions { display: flex; align-items: center; gap: 12px; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.topbar-actions form { margin: 0; }
.service-status { color: #a9dcc4; }
.service-status i { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--success); }

.page { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 73px); }
.sidebar { padding: 30px 20px; border-right: 1px solid var(--line); background: #09131c; }
.sidebar-label { padding: 0 10px; color: #657a87; text-transform: uppercase; letter-spacing: .13em; font-size: 10px; font-weight: 800; }
.nav-item { display: block; margin-top: 8px; padding: 12px 13px; border-radius: 9px; color: #a9bdc7; font-size: 14px; font-weight: 700; }
.nav-item.active { background: rgba(38, 211, 178, .1); color: var(--accent); }
.environment-card { margin-top: 34px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.environment-card span, .environment-card strong, .environment-card code { display: block; }
.environment-card span { color: var(--muted); font-size: 11px; }
.environment-card strong { margin-top: 7px; font-size: 13px; overflow-wrap: anywhere; }
.environment-card code { margin-top: 8px; color: var(--accent); font-size: 11px; }

.content { width: min(1050px, 100%); padding: 42px clamp(24px, 5vw, 70px) 80px; }
.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 26px; }
.page-heading h1 { font-size: clamp(29px, 4vw, 42px); }
.page-heading .muted { max-width: 700px; }
.secure-badge { color: var(--accent); white-space: nowrap; }

.card { padding: 26px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); box-shadow: 0 12px 35px rgba(0, 0, 0, .12); }
.card-heading { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.card-heading h2 { font-size: 18px; }
.card-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.step { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; background: rgba(38, 211, 178, .1); color: var(--accent); font-size: 11px; font-weight: 900; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; position: sticky; bottom: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(13, 24, 34, .94); backdrop-filter: blur(14px); box-shadow: var(--shadow); }

@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; }
  .brand-panel { min-height: auto; padding: 42px; }
  .login-card { padding: 42px; }
  .page { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 30px 20px 70px; }
  .service-status, .user-chip { display: none; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .page-heading { display: block; }
  .secure-badge { display: inline-block; margin-top: 16px; }
}

@media (max-width: 520px) {
  .login-page { padding: 0; place-items: stretch; }
  .login-shell { min-height: 100vh; border: 0; border-radius: 0; }
  .brand-panel { padding: 34px 24px; }
  .login-card { padding: 36px 24px; }
  .topbar { padding: 0 16px; }
  .form-actions { display: grid; grid-template-columns: 1fr; }
}
