@import url('fonts/fonts.css');
/*
 * Admin sign-in pages: login, 2FA, forgot and reset password, setup.
 * Tokens match the app's (frontend/src/assets/tokens.css); dark mode
 * follows the system via prefers-color-scheme.
 */
:root {
  --bg: #f6f3ec;
  --card: #ffffff;
  --muted: #efebe1;
  --ink: #1b1e24;
  --on-ink: #f6f3ec;
  --text: #1b1e24;
  --text-2: #4a4e56;
  --text-3: #6b6f76;
  --text-4: #9599a0;
  --border: #dedad0;
  --field: #cbc6b9;
  --field-bg: #ffffff;
  --ring: #d97d3d;
  --ok: #3f8f6c;
  --ok-fg: #2f6f53;
  --warn: #d97d3d;
  --bad: #c1503b;
  --bad-fg: #a33f2c;
  --bad-bg: rgba(193, 80, 59, .12);
  --shadow: 0 1px 2px rgba(27, 30, 36, .06);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --card: #1b1f26;
    --muted: #22262e;
    --ink: #ece9e1;
    --on-ink: #14171c;
    --text: #ece9e1;
    --text-2: #c7c3ba;
    --text-3: #9599a0;
    --text-4: #6b6f76;
    --border: #2b2f36;
    --field: #3a3f47;
    --field-bg: #14171c;
    --ok-fg: #6cc39b;
    --bad-fg: #e58a76;
    --bad-bg: rgba(193, 80, 59, .2);
    --shadow: none;
  }
  .auth-logo-mark { filter: invert(1); }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); }
a:hover { color: var(--warn); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

.auth-main {
  min-height: 100vh;
  padding: 96px 16px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.auth-logo { display: inline-flex; align-items: center; gap: 8px; }
.auth-logo-mark { width: 26px; height: 26px; }
.auth-logo-word { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.auth-org { font-size: 13px; color: var(--text-3); }

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.auth-title {
  margin: 0;
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.auth-sub { margin: 4px 0 0; color: var(--text-2); }

.auth-form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; }
.auth-field label, .auth-label { font-size: 13px; font-weight: 500; }
.auth-label-row a { font-size: 13px; font-weight: 500; }

.auth-input-wrap { position: relative; }
.auth input[type="text"],
.auth input[type="email"],
.auth input[type="password"] {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--field);
  border-radius: 6px;
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
.auth input:focus { outline: 2px solid var(--ring); outline-offset: 1px; border-color: var(--ink); }
.auth input::placeholder { color: var(--text-4); }
.auth-input-wrap input { padding-right: 44px; }

.auth-otp {
  text-align: center;
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 22px !important;
  letter-spacing: .4em;
  height: 52px !important;
}

.auth-eye {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.auth-eye svg { width: 18px; height: 18px; }
.auth-eye .auth-eye-hide, .auth-eye[aria-pressed="true"] .auth-eye-show { display: none; }
.auth-eye[aria-pressed="true"] .auth-eye-hide { display: inline; }

.auth-btn {
  width: 100%;
  height: 44px;
  border-radius: 6px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--on-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}
.auth-btn:hover { opacity: .92; color: var(--on-ink); }
.auth-btn-outline { background: var(--card); color: var(--text); border-color: var(--field); font-weight: 500; }
.auth-btn-outline:hover { color: var(--text); background: var(--muted); }
.auth-btn img { width: 18px; height: 18px; }

.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  font-size: 12px;
  color: var(--text-3);
}
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.auth-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--bad-bg);
  color: var(--bad-fg);
  font-size: 13px;
}
.auth-help { margin: 0; font-size: 13px; color: var(--text-3); }
.auth-back { margin: 16px 0 0; font-size: 13px; text-align: center; }

.auth-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 4px;
}
.auth-meter span { height: 3px; border-radius: 9px; background: var(--muted); }
.auth-meter[data-score="1"] span:nth-child(-n+1) { background: var(--bad); }
.auth-meter[data-score="2"] span:nth-child(-n+2) { background: var(--warn); }
.auth-meter[data-score="3"] span:nth-child(-n+3) { background: var(--ok); }
.auth-meter[data-score="4"] span { background: var(--ok); }
.auth-meter-label { font-size: 12px; color: var(--text-3); }
.auth-meter-label.is-ok { color: var(--ok-fg); }

.auth-foot {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: var(--text-3);
}
.auth-foot a { color: var(--text-3); }
.auth-lang select {
  border: 0;
  background: transparent;
  color: var(--text-3);
  font: inherit;
  cursor: pointer;
  padding: 2px 0;
}
.auth-lang select:hover { color: var(--text); }
.auth-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .auth-main { padding-top: 64px; }
  .auth-card { padding: 24px 20px; }
}
.auth .captcha { display: flex; justify-content: center; min-height: 65px; }
