/* ─── Auth pages (index.html + server.html) GitHub-light theme ───────────────
   Scoped under .auth-page.
   ─────────────────────────────────────────────────────────────────────────── */

.auth-page {
  --au-bg:          #f6f8fa;
  --au-surface:     #ffffff;
  --au-border-sub:  #d0d7de;
  --au-border-mute: #d8dee4;
  --au-text:        #1f2328;
  --au-muted:       #656d76;
  --au-disabled:    #9198a1;
  --au-blue:        #0969da;
  --au-green:       #1a7f37;
}

.auth-page {
  background: var(--au-bg);
  color: var(--au-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 24px 16px;
  box-sizing: border-box;
}

/* ── Shell ───────────────────────────────────────────────────────────────── */
.auth-shell {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* ── Brand block ─────────────────────────────────────────────────────────── */
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.auth-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--au-surface);
  border: 1px solid var(--au-border-mute);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-logo svg {
  width: 26px;
  height: 26px;
  stroke: var(--au-muted);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--au-muted);
}

.auth-app-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--au-text);
}

.auth-app-sub {
  margin: 0;
  font-size: 13px;
  color: var(--au-muted);
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.auth-card {
  width: 100%;
  background: var(--au-surface);
  border: 1px solid var(--au-border-mute);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--au-text);
}

.auth-card-sub {
  margin: -8px 0 0;
  font-size: 13px;
  color: var(--au-muted);
  line-height: 1.5;
}

/* ── Form elements ───────────────────────────────────────────────────────── */
.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--au-muted);
  margin-bottom: 4px;
}

.auth-page input {
  width: 100%;
  background: var(--au-bg);
  border: 1px solid var(--au-border-mute);
  border-radius: 6px;
  color: var(--au-text);
  font-size: 14px;
  padding: 8px 12px;
  box-sizing: border-box;
  transition: border-color 0.15s;
  font-family: inherit;
}

.auth-page input:focus {
  outline: none;
  border-color: var(--au-blue);
}

.auth-page input::placeholder {
  color: var(--au-disabled);
}

.auth-btn-primary {
  background: #1f883d;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 18px;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s;
  font-family: inherit;
}

.auth-btn-primary:hover {
  background: #1a7f37;
}

.auth-btn-primary:disabled {
  background: var(--au-border-sub);
  color: var(--au-disabled);
  cursor: not-allowed;
}

/* ── Message box ─────────────────────────────────────────────────────────── */
.auth-page .message-box {
  padding: 8px 12px;
  background: var(--au-bg);
  border: 1px solid var(--au-border-sub);
  border-radius: 6px;
  font-size: 13px;
  color: var(--au-muted);
  margin-top: -4px;
}

.auth-page .message-box.status-danger  { color: #cf222e; border-color: #ffc1c0; background: #ffebe9; }
.auth-page .message-box.status-warning { color: #9a6700; border-color: #d4a72c; background: #fff8c5; }
.auth-page .message-box.status-success { color: #1a7f37; border-color: #82cf9a; background: #dafbe1; }

/* ── Server hint footer ──────────────────────────────────────────────────── */
.auth-server-hint {
  margin: 0;
  font-size: 12px;
  color: var(--au-disabled);
  text-align: center;
}

.auth-server-url {
  color: var(--au-muted);
  word-break: break-all;
}

/* ── Dark mode overrides ─────────────────────────────────────────────────── */
html[data-theme="dark"] .auth-page {
  --au-bg:          #0d1117;
  --au-surface:     #161b22;
  --au-border-sub:  #30363d;
  --au-border-mute: #21262d;
  --au-text:        #e6edf3;
  --au-muted:       #7d8590;
  --au-disabled:    #484f58;
  --au-blue:        #58a6ff;
  --au-green:       #3fb950;
}

html[data-theme="dark"] .auth-page .message-box.status-danger  { color: #f85149; border-color: #f85149; background: #3d1c1c; }
html[data-theme="dark"] .auth-page .message-box.status-warning { color: #d29922; border-color: #9e6a03; background: #272115; }
html[data-theme="dark"] .auth-page .message-box.status-success { color: #3fb950; border-color: #238636; background: #12261e; }
