.login-layout {
  --bg-canvas: #0b1623;
  --bg-canvas-accent: #102a3c;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --brand: #0f766e;
  --brand-ring: rgba(15, 118, 110, 0.14);
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #b91c1c;
  min-height: 100vh;
  font: 16px/normal -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  display: grid;
  grid-template-columns: minmax(380px, 44%) 1fr;
}

/* Left Brand Panel */
.brand-pane {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(640px 520px at 18% 15%, rgba(20, 184, 166, 0.22), transparent 65%),
    radial-gradient(560px 460px at 88% 88%, rgba(56, 189, 248, 0.16), transparent 65%),
    linear-gradient(160deg, var(--bg-canvas) 0%, var(--bg-canvas-accent) 100%);
  color: #f8fafc;
  padding: 48px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand-pane::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at 35% 45%, #000 35%, transparent 85%);
  pointer-events: none;
}

.brand-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, #14b8a6 0%, #0284c7 100%);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px -8px rgba(20, 184, 166, 0.55);
  flex-shrink: 0;
}

.brand-logo svg { width: 22px; height: 22px; }

.brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #f8fafc;
}

.brand-center {
  position: relative;
  z-index: 1;
  max-width: 360px;
}

.brand-headline {
  margin: 0 0 18px;
  font-size: 32px;
  line-height: 1.28;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.brand-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.brand-pill {
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.brand-footer {
  position: relative;
  z-index: 1;
  font-size: 12.5px;
  color: rgba(203, 213, 225, 0.65);
}

/* Right Form Panel */
.form-pane {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 28px;
  background: #ffffff;
}

.form-box {
  width: 100%;
  max-width: 368px;
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.form-title {
  margin: 0 0 32px;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.login-layout .field {
  margin-bottom: 18px;
}

.login-layout .field label {
  display: block;
  margin: 0 0 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-layout .field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--text-primary);
  font-size: 14.5px;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.login-layout .field input.has-toggle {
  padding-right: 48px;
}

.login-layout .field input:hover {
  border-color: var(--border-hover);
  background: #ffffff;
}

.login-layout .field input:focus {
  outline: none;
  border-color: var(--brand);
  background: #ffffff;
  box-shadow: 0 0 0 3.5px var(--brand-ring);
}

.toggle-pwd {
  position: absolute;
  right: 10px;
  height: 28px;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.toggle-pwd:hover {
  color: var(--text-primary);
  background: #f1f5f9;
}

.submit-btn {
  width: 100%;
  height: 46px;
  margin-top: 8px;
  border: none;
  border-radius: 10px;
  background: #0f172a;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease;
  box-shadow: 0 8px 20px -10px rgba(15, 23, 42, 0.55);
}

.submit-btn:not(:disabled):hover {
  background: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px -10px rgba(15, 23, 42, 0.5);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.error-banner {
  margin: 16px 0 0;
  padding: 10px 13px;
  border-radius: 9px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  font-size: 13px;
  line-height: 1.5;
}

.error-banner:not(.error) {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: var(--text-secondary);
}
.login-layout[hidden], .error-banner[hidden], .plugin-guide [hidden] { display: none; }
.mobile-brand span { font-weight: 600; font-size: 15px; }
.login-layout button:focus-visible, .plugin-guide :is(a, button):focus-visible {
  outline: 2px solid #0f766e;
  outline-offset: 2px;
}

.browser-tip {
  margin: 28px 0 1em;
  text-align: center;
  font-size: 12.5px;
  line-height: normal;
  color: var(--text-muted);
}

@media (max-width: 860px) {
  .login-layout { grid-template-columns: 1fr; }
  .brand-pane { display: none; }
  .mobile-brand { display: flex; }
  .form-pane { padding: 32px 20px; }
}

/* Download guide in the workbench toolbar */
.plugin-release-download {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 16px;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  font-weight: 600;
}
.plugin-release-download:hover { background: #1e293b; text-decoration: none; }
@media (prefers-reduced-motion: reduce) {
  .login-layout :is(input, button) { transition: none; }
}

#download-extension { background: #ecf7f5; color: #155e55; border-color: #cde4df; }
#download-extension:hover { background: #dfefe9; }

dialog.plugin-guide {
  width: min(calc(100% - 28px), 520px);
  max-height: calc(100dvh - 28px);
  margin: auto;
  padding: 0;
  border: 1px solid #dce8ee;
  border-radius: 18px;
  background: #fff;
  color: #112b42;
  box-shadow: 0 20px 60px #1736473d;
}
.plugin-guide::backdrop { background: #122e4966; }
.plugin-guide-content { padding: clamp(16px, 5vw, 28px); }
.plugin-guide-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.plugin-guide h2 { margin: 0; font-size: clamp(19px, 5vw, 23px); }
.plugin-guide h3 { margin: 20px 0 10px; font-size: 15px; }
.plugin-release {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #d9ebe8;
  border-radius: 10px;
  background: #f3faf8;
}
.plugin-release-status { margin: 0; font-weight: 650; }
.plugin-release-notes { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: #465e70; }
.plugin-release-download { margin-top: 12px; }
.plugin-steps { margin: 0; padding-left: 22px; color: #40576b; line-height: 1.65; }
.plugin-steps li + li { margin-top: 10px; }
.plugin-steps li::marker { font-weight: 700; color: #156d65; }
.plugin-steps code { padding: 1px 4px; border-radius: 4px; background: #edf3f8; overflow-wrap: anywhere; }
