/* ===========================================================
   ACCESS CONSOLE THEME
   ระบบยืนยันตัวตนหลายชั้น — โทนน้ำเงินเข้ม สไตล์คอนโซลควบคุมการเข้าถึง
   =========================================================== */

:root {
  --bg: #05070f;
  --bg-grid: #0a1122;
  --panel: #0d1526;
  --panel-2: #101b32;
  --border: #1d2b4a;
  --border-soft: #16223c;
  --text: #e8edfb;
  --muted: #7c88ac;
  --muted-2: #56628a;
  --accent: #4f6df5;
  --accent-bright: #7c93ff;
  --discord: #5865f2;
  --discord-hover: #4752c4;
  --success: #35d399;
  --danger: #ff5c72;
  --warn: #f5b942;
  --font-ui: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-image:
    linear-gradient(180deg, rgba(79,109,245,0.06), transparent 40%),
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(79,109,245,0.045) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(79,109,245,0.045) 40px);
  background-color: var(--bg);
}

.shell {
  width: 100%;
  max-width: 860px;
  display: grid;
  grid-template-columns: 220px 1fr;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,0.7), 0 0 0 1px rgba(79,109,245,0.05);
}

.shell.single {
  grid-template-columns: 1fr;
  max-width: 460px;
}

/* -------- Sidebar clearance stepper -------- */
.clearance {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border-right: 1px solid var(--border-soft);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.clearance .brand {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted-2);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  position: relative;
}

.step .dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border-soft);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  flex-shrink: 0;
  z-index: 1;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 10px;
  top: 22px;
  width: 1px;
  height: calc(100% + 8px);
  background: var(--border-soft);
}

.step .label {
  padding-top: 2px;
}

.step .label .name {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}

.step .label .sub {
  font-size: 10.5px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  margin-top: 1px;
}

.step.done .dot {
  background: var(--success);
  border-color: var(--success);
  color: #06180f;
}
.step.done:not(:last-child)::after { background: var(--success); opacity: 0.4; }
.step.done .label .name { color: var(--text); }

.step.active .dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(79,109,245,0.18);
}
.step.active .label .name { color: var(--text); }

/* -------- Main panel -------- */
.panel {
  padding: 40px 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin: 0 0 10px;
}

h1.title {
  font-size: 24px;
  margin: 0 0 8px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p.desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 26px;
}

/* -------- Discord button -------- */
.btn-discord {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  background: var(--discord);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn-discord:hover { background: var(--discord-hover); }
.btn-discord:active { transform: scale(0.99); }
.btn-discord svg { width: 20px; height: 20px; flex-shrink: 0; }

.identity-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 22px;
}
.identity-card img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border);
}
.identity-card .who .name { font-size: 14px; font-weight: 600; }
.identity-card .who .tag { font-size: 11px; color: var(--muted-2); font-family: var(--font-mono); }

/* -------- Form elements -------- */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.field input[type="password"],
.field input[type="text"] {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-ui);
  outline: none;
  transition: border-color 0.15s ease;
}
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,109,245,0.16);
}

.code-input {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
.code-input input {
  width: 100%;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 22px;
  letter-spacing: 0.05em;
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 12px 0;
  color: var(--text);
  outline: none;
}
.code-input input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,109,245,0.16);
}

.btn-primary {
  width: 100%;
  padding: 13px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: background 0.15s ease;
  margin-top: 6px;
}
.btn-primary:hover { background: #3d5adf; }

.btn-ghost {
  width: 100%;
  padding: 12px 20px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-ui);
  margin-top: 8px;
  text-decoration: none;
  display: block;
  text-align: center;
}
.btn-ghost:hover { border-color: var(--muted-2); color: var(--text); }

/* -------- Alerts -------- */
.alert {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.5;
}
.alert-error {
  background: rgba(255,92,114,0.1);
  border: 1px solid rgba(255,92,114,0.3);
  color: #ff8a9a;
}
.alert-success {
  background: rgba(53,211,153,0.1);
  border: 1px solid rgba(53,211,153,0.3);
  color: #6fe6bb;
}
.alert-warn {
  background: rgba(245,185,66,0.1);
  border: 1px solid rgba(245,185,66,0.35);
  color: #f5c96a;
}

/* -------- 2FA reveal code block -------- */
.reveal-code {
  font-family: var(--font-mono);
  font-size: 34px;
  letter-spacing: 0.25em;
  text-align: center;
  background: var(--panel-2);
  border: 1px dashed var(--accent);
  border-radius: 10px;
  padding: 18px 10px;
  margin: 18px 0;
  color: var(--accent-bright);
}

/* -------- Role selection -------- */
.role-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.role-btn {
  background: var(--panel-2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 22px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font-ui);
  transition: border-color 0.15s ease, transform 0.1s ease, background 0.15s ease;
}
.role-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  background: rgba(79,109,245,0.08);
}
.role-btn svg { width: 30px; height: 30px; }
.role-btn .role-name { font-size: 13px; font-weight: 700; letter-spacing: 0.03em; }
.role-btn .role-code { font-size: 10px; color: var(--muted-2); font-family: var(--font-mono); }

.role-btn.police svg { color: #5b8def; }
.role-btn.ems svg { color: #ff6b6b; }
.role-btn.council svg { color: #f5c96a; }

footer.meta {
  margin-top: 22px;
  font-size: 11px;
  color: var(--muted-2);
  text-align: center;
  font-family: var(--font-mono);
}

@media (max-width: 640px) {
  .shell { grid-template-columns: 1fr; }
  .clearance { display: none; }
  .role-grid { grid-template-columns: 1fr; }
}
