/* ─── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #111316;
  --card-bg:   #1a1d21;
  --border:    #2e3136;
  --input-bg:  #222529;
  --text:      #d1d2d3;
  --muted:     #6b6e75;
  --bright:    #ffffff;
  --accent:    #1d9bd1;
  --accent-h:  #1589bc;
  --green:     #2bac76;
  --yellow:    #e3b341;
  --red:       #f85149;
  --radius:    8px;
  --font:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

/* ─── Background ─────────────────────────────────── */
#login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(29,155,209,.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(43,172,118,.06) 0%, transparent 50%),
    var(--bg);
  padding: 20px;
}

#login-wrap {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* ─── Card ───────────────────────────────────────── */
#login-card {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 32px 28px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}

/* ─── Logo ───────────────────────────────────────── */
#login-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.logo-shield {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--accent) 0%, #0d6fa3 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 900; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(29,155,209,.35);
}

.logo-title {
  font-size: 20px; font-weight: 700; color: var(--bright);
  letter-spacing: -.3px;
}
.logo-sub {
  font-size: 12px; color: var(--muted); margin-top: 2px;
}

/* ─── Form ───────────────────────────────────────── */
.field-group {
  margin-bottom: 16px;
}
.field-group label {
  display: block;
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 6px;
}
.field-group input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--bright);
  font-size: 14px; padding: 10px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29,155,209,.15);
}
.field-group input::placeholder { color: var(--muted); }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 38px; }
.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 16px; opacity: .5; transition: opacity .12s;
  padding: 4px;
}
.pw-toggle:hover { opacity: 1; }

/* ─── Error ──────────────────────────────────────── */
.error-msg {
  background: rgba(248,81,73,.12);
  border: 1px solid rgba(248,81,73,.3);
  border-radius: var(--radius);
  color: #ff7e79;
  font-size: 13px; padding: 10px 12px;
  margin-bottom: 14px;
}

/* ─── Login button ───────────────────────────────── */
.btn-login {
  width: 100%;
  padding: 11px;
  background: var(--accent);
  color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s, transform .1s;
  margin-top: 4px;
}
.btn-login:hover:not(:disabled) { background: var(--accent-h); }
.btn-login:active:not(:disabled) { transform: scale(.98); }
.btn-login:disabled { opacity: .6; cursor: not-allowed; }

/* ─── Spinner ────────────────────────────────────── */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Hint ───────────────────────────────────────── */
.login-hint {
  margin-top: 18px;
  font-size: 12px; color: var(--muted); text-align: center;
}
.login-hint code {
  background: rgba(29,155,209,.15); color: var(--accent);
  padding: 1px 6px; border-radius: 4px; font-size: 12px;
}

/* ─── Account table ──────────────────────────────── */
.account-table {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.account-title {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 10px;
}
.account-row {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 0;
}
.acc-role {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 20px;
  min-width: 54px; text-align: center;
}
.acc-role.admin    { background: rgba(29,155,209,.2);  color: var(--accent); }
.acc-role.engineer { background: rgba(43,172,118,.2);  color: var(--green); }
.acc-role.pm       { background: rgba(227,179,65,.2);  color: var(--yellow); }
.acc-role.customer { background: rgba(188,140,255,.2); color: #bc8cff; }

.acc-info {
  font-size: 12px; color: var(--muted);
  background: var(--input-bg); padding: 3px 8px;
  border-radius: 4px; border: 1px solid var(--border);
}
.acc-info.clickable {
  cursor: pointer; transition: color .12s, border-color .12s;
}
.acc-info.clickable:hover {
  color: var(--accent); border-color: var(--accent);
}
.account-note {
  font-size: 11px; color: var(--muted); text-align: center;
  margin-top: 8px; font-style: italic;
}

/* ─── Footer ─────────────────────────────────────── */
#login-footer {
  font-size: 11px; color: var(--muted); text-align: center;
}
