:root {
  color-scheme: dark;
  --bg: #07090b;
  --panel: #101317;
  --panel-strong: #0b0e11;
  --line: #2a3037;
  --line-strong: #3b444d;
  --text: #f3f5f7;
  --muted: #8e98a5;
  --green: #43d45c;
  --green-strong: #56d364;
  --green-wash: rgba(67, 212, 92, .1);
  --danger: #ff737a;
  --warning: #e7b14f;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a { color: inherit; }
button,
input { font: inherit; }

.auth-page,
.workspace-page {
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    radial-gradient(980px 620px at 8% 4%, rgba(67, 212, 92, .14), transparent 64%),
    var(--bg);
  background-size: 48px 48px, 48px 48px, auto, auto;
}

.top-shell,
.page-footer,
.workspace-head-inner,
.workspace-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.top-shell,
.workspace-head-inner {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.top-shell { border-bottom: 1px solid var(--line); }
.workspace-head { border-bottom: 1px solid var(--line); background: rgba(7, 9, 11, .92); }

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

.brand img {
  width: 144px;
  height: 58px;
  display: block;
}

.experience-badge {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  border: 1px solid rgba(67, 212, 92, .46);
  padding: 0 9px;
  color: var(--green);
  background: var(--green-wash);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
}

.top-link,
.panel-foot a {
  color: var(--green);
  font-size: 14px;
  font-weight: 760;
  text-underline-offset: 5px;
}

.brand:focus-visible,
.top-link:focus-visible,
.panel-foot a:focus-visible,
.action-link:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}

.auth-screen {
  min-height: 100vh;
  padding: 32px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(67, 212, 92, .08), transparent 46%),
    radial-gradient(880px 520px at 14% 16%, rgba(67, 212, 92, .16), transparent 62%);
}

.auth-shell {
  width: min(1280px, calc(100% - 64px));
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 34px 90px rgba(0, 0, 0, .34);
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, .72fr);
}

.auth-hero {
  min-height: 620px;
  padding: clamp(34px, 5vw, 58px);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 46px;
  background:
    linear-gradient(135deg, rgba(67, 212, 92, .12), transparent 46%),
    var(--panel);
}

.auth-panel {
  padding: clamp(34px, 5vw, 64px);
  display: grid;
  place-items: center;
  background: var(--panel-strong);
}

.auth-brand-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.eyebrow,
.panel-head > p {
  margin: 0 0 16px;
  color: var(--green);
  font: 800 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .17em;
}

.auth-hero h1,
.workspace-intro h1 {
  margin: 0;
  max-width: 660px;
  font-size: clamp(42px, 5.2vw, 66px);
  line-height: 1.05;
  letter-spacing: -.045em;
}

.lead {
  margin: 26px 0 0;
  max-width: 650px;
  color: #aeb6c0;
  font-size: 17px;
  line-height: 1.9;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.feature-strip span {
  padding: 18px 19px;
  border-right: 1px solid var(--line);
  color: var(--green);
  font: 800 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .08em;
}

.feature-strip span:last-child { border-right: 0; }
.panel-inner { width: min(100%, 440px); }
.panel-head { margin-bottom: 28px; }

.panel-head h2 {
  margin: 0;
  font-size: 31px;
  letter-spacing: -.025em;
}

.panel-head span {
  display: block;
  margin-top: 11px;
  color: var(--muted);
  line-height: 1.7;
}

.account-form { display: grid; gap: 12px; }

label {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 760;
}

input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 0 14px;
  color: var(--text);
  background: #070a0d;
  outline: none;
}

input::placeholder { color: #68727d; }

input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(67, 212, 92, .12);
}

button,
.action-link {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 0;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

button:disabled { cursor: wait; opacity: .58; }
.primary { color: #061007; background: var(--green); }
.primary:hover:not(:disabled) { background: var(--green-strong); }
.secondary { color: var(--green); border-color: rgba(67, 212, 92, .42); background: var(--green-wash); }
.secondary:hover:not(:disabled) { background: rgba(67, 212, 92, .17); }
.secondary.compact { min-height: 38px; padding: 0 14px; }

#loginButton { width: 100%; margin-top: 12px; }

.form-message {
  min-height: 22px;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.form-message.error { color: var(--danger); }
.form-message.success { color: var(--green); }

.panel-foot {
  margin: 22px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.panel-foot a { margin-left: 6px; }

.page-footer {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.account-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.identity-label {
  max-width: 360px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-shell {
  min-height: calc(100vh - 168px);
  padding: clamp(42px, 6vw, 72px) 0 80px;
}

.workspace-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  padding-bottom: 38px;
  border-bottom: 1px solid var(--line);
}

.workspace-intro h1 { font-size: clamp(40px, 5vw, 60px); }
.workspace-content { padding-top: 28px; }

.section-head {
  min-height: 50px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.section-head h2 { margin: 0; font-size: 20px; }
.section-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.section-head p.error { color: var(--danger); }

.tenant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.tenant-card {
  min-height: 230px;
  border: 1px solid var(--line);
  padding: 23px;
  display: grid;
  align-content: space-between;
  gap: 28px;
  background:
    linear-gradient(135deg, rgba(67, 212, 92, .055), transparent 42%),
    rgba(16, 19, 23, .96);
}

.tenant-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.tenant-card h3 { margin: 0; font-size: 20px; line-height: 1.35; }
.tenant-meta { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }

.status-tag {
  flex: none;
  min-height: 26px;
  border: 1px solid var(--line-strong);
  padding: 4px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-tag.active { border-color: rgba(67, 212, 92, .5); color: var(--green); background: var(--green-wash); }
.status-tag.provisioning { border-color: rgba(231, 177, 79, .5); color: var(--warning); background: rgba(231, 177, 79, .08); }
.status-tag.frozen,
.status-tag.expired { border-color: rgba(255, 115, 122, .42); color: var(--danger); background: rgba(255, 115, 122, .07); }

.tenant-card-bottom {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.tenant-action-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.tenant-card .action-link { margin-top: 0; }

.empty-state {
  border: 1px solid var(--line);
  padding: clamp(30px, 5vw, 54px);
  text-align: center;
  background: rgba(16, 19, 23, .92);
}

.empty-state h2 { margin: 0; font-size: 27px; }
.empty-state > p:not(.eyebrow) { max-width: 520px; margin: 15px auto 0; color: var(--muted); line-height: 1.75; }
.empty-state .action-link { margin-top: 25px; }

.workspace-footer { margin-top: 0; }

@media (max-width: 900px) {
  .auth-screen { padding: 16px; }
  .auth-shell { width: 100%; }
  .auth-card { grid-template-columns: 1fr; }
  .auth-hero { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-panel { min-height: auto; }
}

@media (max-width: 640px) {
  .top-shell,
  .page-footer,
  .workspace-head-inner,
  .workspace-shell { width: min(100% - 28px, 1180px); }
  .top-shell,
  .workspace-head-inner { min-height: 76px; }
  .brand { gap: 8px; }
  .brand img { width: 124px; height: 50px; }
  .experience-badge { display: none; }
  .top-link { max-width: 135px; font-size: 12px; text-align: right; }
  .auth-screen { padding: 0; place-items: stretch; }
  .auth-shell { width: 100%; border-right: 0; border-left: 0; }
  .auth-hero,
  .auth-panel { padding: 30px 20px; }
  .auth-hero h1 { font-size: clamp(38px, 12vw, 52px); }
  .feature-strip { grid-template-columns: 1fr; }
  .feature-strip span { border-right: 0; border-bottom: 1px solid var(--line); }
  .feature-strip span:last-child { border-bottom: 0; }
  .page-footer { align-items: flex-start; flex-direction: column; justify-content: center; padding: 24px 0; }
  .identity-label { display: none; }
  .workspace-intro,
  .section-head { align-items: flex-start; flex-direction: column; }
  .workspace-intro .secondary { width: 100%; }
  .tenant-grid { grid-template-columns: 1fr; }
}
