/* Base-folder pages: sign-in and module dashboard. Matches the CAD dark theme. */
:root {
  --bg: #0d1218;
  --panel: #141b23;
  --panel-2: #1a232d;
  --panel-3: #222d39;
  --line: #2a3644;
  --text: #e6edf3;
  --muted: #8d9aa8;
  --accent: #4da3ff;
  --warn: #f2a516;
  --alert: #ef4444;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}
a { color: var(--accent); }
.text-muted { color: var(--muted) !important; }
.form-control {
  background: var(--panel-2); border-color: var(--line); color: var(--text);
}
.form-control:focus {
  background: var(--panel-2); color: var(--text); border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(77, 163, 255, .35);
}

/* Sign-in */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 12px; }
.login-card {
  width: 100%; max-width: 400px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px;
}
.login-brand { font-weight: 800; letter-spacing: .1em; color: var(--accent); font-size: 13px; }
.login-org { font-size: 20px; font-weight: 700; margin: 4px 0 20px; }
.login-card label { font-size: 12px; color: var(--muted); font-weight: 600; }
.login-card .form-control { height: 46px; font-size: 17px; }
.login-card .btn { height: 46px; font-weight: 700; }
.login-error { color: var(--alert); font-weight: 600; margin-bottom: 12px; }
.login-flash { color: var(--warn); font-weight: 600; margin-bottom: 12px; }
.login-phase {
  font-size: 12px; color: #111; background: #fde68a; border-radius: 6px; padding: 6px 10px; margin-top: 16px;
}
.login-step { margin: -6px 0 14px; font-size: 14px; }
.login-code { letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.login-restart { height: auto !important; font-weight: 400 !important; margin-top: 6px; }
.login-help { font-size: 12px; color: var(--muted); margin: 6px 0 0; text-align: center; }
.login-notice { font-size: 11px; color: var(--muted); margin-top: 14px; line-height: 1.4; }

/* Dashboard */
.dash-top {
  display: flex; align-items: center; gap: 12px;
  height: 52px; padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.dash-brand { font-weight: 800; letter-spacing: .08em; color: var(--accent); }
.dash-org { color: var(--muted); }
.dash-user { margin-left: auto; font-size: 14px; color: var(--text); padding: 4px 8px; border-radius: 6px; }
a.dash-user:hover, a.dash-user:focus { background: var(--panel-3); color: var(--text); text-decoration: none; }
.dash-user .role { color: var(--muted); font-size: 12px; margin-left: 4px; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { background: var(--panel-3); color: var(--text); }
.dash-main { max-width: 960px; margin: 0 auto; padding: 32px 16px; }
.dash-main h1 { font-size: 22px; font-weight: 700; margin-bottom: 18px; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.module-card {
  display: block; padding: 20px; border-radius: 10px; text-decoration: none !important;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-left: 5px solid var(--accent);
}
.module-card:hover { border-color: var(--accent); background: var(--panel-2); color: var(--text); }
.module-name { font-size: 26px; font-weight: 800; letter-spacing: .04em; }
.module-title { font-weight: 600; margin-top: 2px; }
.module-preview {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; vertical-align: middle;
  color: var(--warn); border: 1px solid var(--warn); border-radius: 4px; padding: 1px 6px; margin-left: 6px;
}
.module-desc { color: var(--muted); font-size: 13px; margin-top: 8px; }
.module-open { color: var(--accent); font-weight: 700; font-size: 13px; margin-top: 14px; }
.dash-note { color: var(--muted); font-size: 12px; margin-top: 22px; }

@media (max-width: 575px) {
  .dash-org { display: none; }
}

/* Profile (profile.php) */
.profile { max-width: 760px; }
.profile h2 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.profile-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.profile-panel.needs { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn); }
.profile-panel label { font-size: 12px; color: var(--muted); font-weight: 600; }
.profile-fixed { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; margin: 18px 0 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.profile-fixed dt { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.profile-fixed dd { margin: 0; font-size: 14px; }
.profile-setup ol { padding-left: 20px; margin-top: 6px; }
.profile-steps { padding-left: 20px; }
.profile-steps li { margin-bottom: 10px; }
.qr-box { width: 240px; height: 240px; margin: 10px 0; background: #fff; border-radius: 8px; padding: 6px; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.totp-key { font-size: 15px; letter-spacing: .05em; user-select: all; }
.profile-code .login-code { width: 130px; }
