/* E-Power LINC sign-in screen and account menu (auth.js).
   Restrained, like the rest of the brand: one card, one accent, the mark as it is in the top bar. */

html.auth-open { overflow: hidden; }

.auth-screen {
  position: fixed; inset: 0; z-index: 200;
  display: grid; grid-template-rows: 1fr auto; justify-items: center; align-items: center;
  padding: 24px 16px 18px; overflow: auto; background: var(--bg);
}
.auth-screen[hidden] { display: none; }
/* a breath of the accent behind the card, nothing more */
.auth-screen::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(55% 42% at 50% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 72%);
}

.auth-card {
  position: relative; width: min(400px, 100%); padding: 28px 28px 24px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-panel);
  box-shadow: var(--float);
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; color: var(--muted); font: 400 var(--t-lg) "Geist", var(--sans); }
.auth-brand b { color: var(--text); font-weight: 600; letter-spacing: .05em; }
.auth-brand .brand-mark { width: 30px; height: 30px; }

.auth-card h1 { margin: 0 0 6px; font: 600 var(--t-xl)/1.25 var(--sans); letter-spacing: -.01em; color: var(--text); }
.auth-lead { margin: 0 0 20px; font-size: var(--t-md); line-height: 1.55; color: var(--muted); }
.auth-lead b { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }

.auth-card .field { margin-bottom: 14px; }
.auth-card .field input { height: 40px; font-size: var(--t-md); }
.auth-wide { width: 100%; height: 40px; font-size: var(--t-md); display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.auth-card form .auth-wide { margin-top: 4px; }
.auth-social { display: grid; gap: 10px; }
.auth-ms { color: var(--text); }
.auth-ms svg { width: 16px; height: 16px; flex: none; }

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

.auth-hint { margin: 16px 0 0; font-size: var(--t-xs); line-height: 1.5; color: var(--faint); }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; font-size: var(--t-sm); }
.auth-links a { color: var(--accent); text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.auth-links a:only-child { margin: 0 auto; }

.auth-note { margin-top: 16px; padding: 9px 12px; border-radius: var(--r-ctl); border: 1px solid var(--line); font-size: var(--t-sm); line-height: 1.5; color: var(--muted); }
.auth-note[data-kind="bad"] { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.auth-note[data-kind="ok"] { color: var(--ok); border-color: var(--ok-line); }

.auth-close { position: absolute; top: 12px; right: 12px; font-size: var(--t-lg); line-height: 1; }
.auth-foot { position: relative; margin: 18px 0 0; font-size: var(--t-xs); color: var(--faint); }

/* the avatar becomes the account button once sign-in is on */
.avatar.auth-on { cursor: pointer; }
.auth-menu {
  position: fixed; top: 52px; right: 16px; z-index: 120; min-width: 230px; padding: 14px;
  display: flex; flex-direction: column; gap: 3px; font-size: var(--t-sm);
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--float);
}
.auth-menu b { color: var(--text); font-weight: 600; }
.auth-menu span { color: var(--muted); overflow-wrap: anywhere; }
.auth-menu .auth-role { font-size: var(--t-xs); margin-top: 4px; }
.auth-menu .btn { margin-top: 12px; }

/* name and role in Co-Space come from the account */
#role:disabled, #userName:disabled { opacity: .8; cursor: default; }

@media (max-width: 480px) {
  .auth-card { padding: 22px 18px 20px; }
}

/* ---------- the back office: accounts (admin.js) ---------- */
.admin-screen { position: fixed; inset: 0; z-index: 190; display: grid; grid-template-columns: minmax(0, 1fr); place-items: start center; padding: 28px 16px; overflow: auto; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(3px); }
.admin-box { width: min(1040px, 100%); min-width: 0; padding: 22px 24px 24px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-panel); box-shadow: var(--float); }
.admin-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.admin-head h1 { margin: 0 0 4px; font: 600 var(--t-xl)/1.25 var(--sans); letter-spacing: -.01em; color: var(--text); }
.admin-head p { margin: 0; font-size: var(--t-sm); line-height: 1.5; }
.admin-head-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.admin-head-actions .icon-btn { font-size: var(--t-lg); line-height: 1; }

.admin-add { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; padding: 16px 16px 14px; margin-bottom: 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.admin-add .field { margin-bottom: 12px; }
.admin-add .field input, .admin-add .field select { height: 36px; width: 100%; }
.admin-add-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.admin-add-foot span { margin-right: auto; }

.admin-table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.admin-table table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.admin-table th { text-align: left; padding: 9px 14px; font-size: var(--t-xs); font-weight: 500; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--text); }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tr[data-row] { cursor: pointer; }
.admin-table tr[data-row]:hover td, .admin-table tr.open td { background: var(--hover); }
.admin-table tr.dim td { color: var(--muted); }
.admin-table td b { font-weight: 600; }
.admin-you { margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: var(--t-xs); font-weight: 500; color: var(--accent); background: var(--accent-dim); }
/* the actions sit on the panel itself, so the buttons (--panel-2) stand out */
.admin-detail td { padding-top: 4px; }
.admin-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.admin-inline input { height: 32px; min-width: 280px; flex: 1; font-size: var(--t-sm); }
.admin-inline span { flex: 1 1 320px; font-size: var(--t-sm); line-height: 1.5; color: var(--text); }
.admin-inline .admin-me { color: var(--muted); }
.admin-danger { color: var(--bad); }
.admin-danger:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.admin-box > .auth-note { margin: 0 0 14px; }

@media (max-width: 760px) {
  .admin-box { padding: 18px 14px; }
  .admin-head { flex-direction: column; }
  .admin-add { grid-template-columns: 1fr; }
  .admin-table th:nth-child(3), .admin-table td:nth-child(3), .admin-table th:nth-child(6), .admin-table td:nth-child(6) { display: none; }
}
