/* ============================================================
   auth.css — login page + admin console
   ============================================================ */

/* ---------------- shared shell ---------------- */

.auth-body {
  min-height: 100vh;
  background:
    linear-gradient(rgba(0,0,0,0.65), rgba(0,0,0,0.88)),
    radial-gradient(1100px 620px at 50% -12%, #3a0d10 0%, var(--bg) 62%);
}

.auth-header {
  padding: 1.25rem 4%;
}

.auth-wrap {
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem 5rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(0,0,0,0.72);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 2.75rem 2.5rem 2.25rem;
}

.auth-title { margin: 0 0 0.5rem; font-size: 1.9rem; }
.auth-lead { margin: 0 0 1.5rem; color: var(--text-dim); font-size: 0.92rem; }
.auth-foot a { color: #fff; text-decoration: underline; }

.auth-fine {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid #2a2a2a;
  color: var(--text-dim2);
  font-size: 0.76rem;
  line-height: 1.6;
}

/* password strength */
.pw-meter {
  display: flex; align-items: center; gap: 0.7rem;
  margin: -0.4rem 0 0.9rem;
}
.pw-meter__bar {
  flex: 1; height: 4px;
  background: #333; border-radius: 4px; overflow: hidden;
}
.pw-meter__bar i {
  display: block; height: 100%; width: 0;
  transition: width 0.25s var(--ease), background 0.25s;
}
.pw-meter span { font-size: 0.74rem; font-weight: 600; min-width: 78px; }

/* ---------------- floating-label fields ---------------- */

.field { position: relative; display: block; margin-bottom: 1rem; }

.field input {
  width: 100%;
  padding: 1.4rem 1rem 0.55rem;
  background: #333;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #fff;
  font-size: 1rem;
}
.field input:focus { outline: none; background: #454545; border-color: #666; }

.field span {
  position: absolute;
  left: 1rem; top: 50%;
  transform: translateY(-50%);
  color: #8c8c8c;
  font-size: 1rem;
  pointer-events: none;
  transition: transform 0.15s var(--ease), font-size 0.15s var(--ease);
}
.field input:focus + span,
.field input:not(:placeholder-shown) + span {
  transform: translateY(-140%);
  font-size: 0.72rem;
}

.field__peek {
  position: absolute;
  right: 0.85rem; top: 50%;
  transform: translateY(-50%);
  background: none; border: 0;
  color: #8c8c8c;
  font-size: 0.82rem; font-weight: 600;
}
.field__peek:hover { color: #fff; }

.auth-submit { width: 100%; margin-top: 1rem; padding: 0.9rem; font-size: 1rem; }
.auth-submit:disabled { opacity: 0.6; cursor: default; }

.auth-msg { min-height: 1.3em; margin: 0.9rem 0 0; font-size: 0.9rem; }
.auth-msg.is-error { color: #ff6b6b; }
.auth-msg.is-ok { color: #4ade80; }

.auth-foot {
  margin: 1.75rem 0 0;
  color: var(--text-dim2);
  font-size: 0.85rem;
  line-height: 1.6;
}

.auth-notice {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
  line-height: 1.5;
  background: rgba(229,9,20,0.12);
  border: 1px solid rgba(229,9,20,0.35);
}
.auth-notice.is-warn {
  background: rgba(232,168,26,0.12);
  border-color: rgba(232,168,26,0.4);
}
.auth-notice strong { color: #fff; }
.auth-notice span { color: var(--text-dim); }

/* ---------------- admin console ---------------- */

.admin { padding: calc(var(--header-h) + 2rem) 4% 5rem; }

.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.admin-head h1 { margin: 0 0 0.25rem; font-size: 1.8rem; }
.admin-head p  { margin: 0; color: var(--text-dim); font-size: 0.92rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  margin-bottom: 2rem;
}
.stat {
  background: var(--bg-2);
  border: 1px solid #262626;
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}
.stat b { display: block; font-size: 1.7rem; line-height: 1.2; }
.stat span { color: var(--text-dim2); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; }
.stat.is-pending b { color: #e8a81a; }

.admin-bar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.admin-bar input {
  flex: 1 1 220px;
  padding: 0.6rem 0.9rem;
  background: var(--bg-3);
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  color: #fff;
  font-size: 0.92rem;
}
.admin-bar input:focus { outline: 2px solid var(--red); outline-offset: 1px; }

.filters { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.filter {
  background: var(--bg-3);
  border: 1px solid #3a3a3a;
  color: var(--text-dim);
  border-radius: 20px;
  padding: 0.45rem 0.95rem;
  font-size: 0.84rem;
}
.filter.is-on { background: #fff; color: #000; border-color: #fff; font-weight: 700; }

/* table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid #262626;
  border-radius: 8px;
  background: var(--bg-2);
}
table.users { width: 100%; border-collapse: collapse; min-width: 760px; }
table.users th,
table.users td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid #262626;
  font-size: 0.9rem;
  vertical-align: middle;
}
table.users th {
  color: var(--text-dim2);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: #1b1b1b;
  position: sticky; top: 0;
}
table.users tr:last-child td { border-bottom: 0; }
table.users tbody tr:hover { background: #1e1e1e; }

.u-email { font-weight: 600; }
.u-name  { color: var(--text-dim2); font-size: 0.8rem; }

.pill {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.pill--approved  { background: rgba(70,211,105,0.15); color: #46d369; }
.pill--pending   { background: rgba(232,168,26,0.15); color: #e8a81a; }
.pill--suspended { background: rgba(255,107,107,0.15); color: #ff6b6b; }
.pill--admin     { background: rgba(229,9,20,0.18); color: #ff5a63; }
.pill--user      { background: #2c2c2c; color: var(--text-dim); }

.row-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.mini {
  background: var(--bg-3);
  border: 1px solid #3a3a3a;
  color: #ddd;
  border-radius: 4px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  white-space: nowrap;
}
.mini:hover { background: #333; color: #fff; }
.mini--ok     { border-color: #2b6b3d; color: #46d369; }
.mini--ok:hover { background: rgba(70,211,105,0.15); }
.mini--warn   { border-color: #7a5a12; color: #e8a81a; }
.mini--warn:hover { background: rgba(232,168,26,0.15); }
.mini--danger { border-color: #7a2126; color: #ff6b6b; }
.mini--danger:hover { background: rgba(255,107,107,0.15); }
.mini:disabled { opacity: 0.4; cursor: default; }

/* create-user dialog */
.dlg { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1.5rem; }
.dlg__bg { position: fixed; inset: 0; background: rgba(0,0,0,0.75); }
.dlg__card {
  position: relative;
  width: 100%; max-width: 440px;
  background: var(--bg-2);
  border: 1px solid #2c2c2c;
  border-radius: 10px;
  padding: 2rem;
  animation: pop 0.24s var(--ease);
}
.dlg__card h2 { margin: 0 0 1.25rem; font-size: 1.3rem; }
.dlg__row { display: flex; gap: 0.6rem; margin-top: 1.25rem; }
.dlg__row .btn { flex: 1; }

.checkline {
  display: flex; align-items: center; gap: 0.55rem;
  color: var(--text-dim); font-size: 0.9rem;
  margin: 0.35rem 0 0;
}
.checkline input { width: 16px; height: 16px; accent-color: var(--red); }

.gen-note {
  background: var(--bg-3);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 1rem;
  word-break: break-all;
}
.gen-note code { color: #fff; font-family: ui-monospace, Consolas, monospace; }

/* ---------------- admin tabs ---------------- */

.tabs { display: flex; gap: 0.3rem; margin-left: 0.5rem; }
.tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  padding: 0.45rem 0.7rem;
  font-size: 0.88rem;
  white-space: nowrap;
}
.tab:hover { color: #fff; }
.tab.is-on { color: #fff; border-bottom-color: var(--red); font-weight: 700; }

/* live indicators */
.stat.is-live b { color: #46d369; }

.dot-live {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #46d369;
  box-shadow: 0 0 8px #46d369;
  margin-right: 6px;
  vertical-align: middle;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }

.prog {
  height: 4px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.25rem;
}
.prog i { display: block; height: 100%; background: var(--red); }

.mono { font-family: ui-monospace, Consolas, monospace; font-size: 0.8rem; }

/* ---------------- user detail drawer ---------------- */

.drawer { position: fixed; inset: 0; z-index: 200; }
.drawer__bg { position: fixed; inset: 0; background: rgba(0,0,0,0.7); }

.drawer__panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(560px, 100%);
  overflow-y: auto;
  background: var(--bg-2);
  border-left: 1px solid #2c2c2c;
  padding: 2rem 2rem 3rem;
  box-shadow: -18px 0 50px rgba(0,0,0,0.6);
  animation: slideIn 0.26s var(--ease);
}
@keyframes slideIn { from { transform: translateX(100%); } }

.drawer__close {
  position: absolute;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 0;
  background: #2a2a2a;
  color: #fff;
  font-size: 1.5rem; line-height: 1;
}
.drawer__close:hover { background: var(--red); }

.drawer__title { margin: 0 0 0.2rem; font-size: 1.4rem; }
.drawer__sub { margin: 0 0 1rem; color: var(--text-dim2); font-size: 0.88rem; word-break: break-all; }
.drawer__pills { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.5rem; }

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
  margin: 0;
}
.facts div { min-width: 0; }
.facts dt { color: var(--text-dim2); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.5px; }
.facts dd { margin: 0.15rem 0 0; color: #eee; font-size: 0.9rem; word-break: break-word; }

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #262626;
  font-size: 0.86rem;
}
.mini-list li:last-child { border-bottom: 0; }

@media (max-width: 780px) {
  .auth-card { padding: 2rem 1.5rem; }
  .admin { padding-top: calc(var(--header-h) + 1.25rem); }
  .tabs { width: 100%; overflow-x: auto; margin: 0; }
  .drawer__panel { padding: 1.5rem 1.25rem 2.5rem; }
  .facts { grid-template-columns: 1fr; }
}
