/* auth.css — glass UI for the credential barrier.
 *
 * One accent only: cyan (--primary). Near-black body with a single radial
 * glow, frosted panels over backdrop-blur. Matches the platform's glass
 * tokens (see ad_module/static/glass.css :root) so the login/admin pages
 * read as part of {Layer10}, not a foreign widget.
 */
:root {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --primary: 187 100% 42%;
  --primary-foreground: 0 0% 0%;
  --muted-foreground: 240 5% 64.9%;
  --border: rgba(255, 255, 255, 0.1);
  --surface: rgba(255, 255, 255, 0.05);
  --surface2: rgba(255, 255, 255, 0.03);
  --radius: 14px;
  --danger: 0 84% 60%;
  --ok: 142 71% 45%;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

body {
  font-family: var(--sans);
  color: hsl(var(--foreground));
  background: hsl(var(--background)) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  overflow-x: hidden;
}

/* Single cyan radial glow behind everything (glass needs color to refract). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(
    circle at 50% 35%,
    hsl(187 100% 42% / 0.18),
    transparent 60%
  );
  pointer-events: none;
}

.glass-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  padding: 2.25rem 2rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
}

.glass-card.wide { max-width: 760px; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.brand .dot {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffba3a, #f5a623 60%, #b9791a);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.18), 0 0 12px rgba(245, 166, 35, 0.35);
}

.brand .sub {
  font-weight: 500;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}

h1 {
  font-size: 1.4rem;
  margin: 0.5rem 0 0.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.lede {
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
  margin: 0 0 1.5rem;
}

label {
  display: block;
  font-size: 0.78rem;
  color: hsl(var(--muted-foreground));
  margin: 0 0 0.35rem 0.1rem;
}

.field { margin-bottom: 1rem; }

input[type="text"],
input[type="password"],
select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  color: hsl(var(--foreground));
  font-family: var(--mono);
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.18);
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: filter 0.15s, transform 0.05s;
}

.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }

.btn-ghost {
  background: transparent;
  color: hsl(var(--muted-foreground));
  border: 1px solid var(--border);
  width: auto;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
}

.btn-ghost:hover { color: hsl(var(--foreground)); border-color: hsl(var(--primary)); }
.btn-danger { background: hsl(var(--danger)); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }

.alert {
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.alert-error {
  background: hsl(var(--danger) / 0.12);
  border-color: hsl(var(--danger) / 0.4);
  color: hsl(var(--danger) / 0.9);
}

.alert-ok {
  background: hsl(var(--ok) / 0.12);
  border-color: hsl(var(--ok) / 0.4);
  color: hsl(var(--ok) / 0.95);
}

.muted { color: hsl(var(--muted-foreground)); font-size: 0.82rem; }

.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
}

.topnav a {
  color: hsl(var(--primary));
  text-decoration: none;
}
.topnav a:hover { text-decoration: underline; }

/* Admin user table */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1rem;
  font-size: 0.85rem;
}

th, td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: hsl(var(--muted-foreground));
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td .role-pill {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 99px;
  font-size: 0.72rem;
  border: 1px solid var(--border);
}

td .role-pill.admin {
  border-color: hsl(var(--primary) / 0.5);
  color: hsl(var(--primary));
}

.row-form {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.row-form input[type="password"] {
  width: 140px;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
}

.inline-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: end;
}

.inline-row .field { flex: 1; min-width: 140px; margin-bottom: 0; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

.hidden { display: none; }
