/* ════════════════════════════════════════════════════════════════════════
   auth-client — all styles
   Sections:  VARIABLES · BASE · BACKGROUND · NAVBAR · LOGIN · APP · ERROR
   App-specific styling lives under the APP section at the bottom.
   ════════════════════════════════════════════════════════════════════════ */

/* ── VARIABLES ───────────────────────────────────────────────────────────
   Shared palette — build new UI with these instead of hardcoded colors. */
:root {
  --bg: #0c0c12;
  --card: #111120;
  --border:        rgba(255, 255, 255, 0.14);
  --border-active: rgba(255, 255, 255, 0.42);
  --text:          rgba(255, 255, 255, 0.82);
  --text-dim:      rgba(255, 255, 255, 0.45);
  --accent:        rgba(255, 255, 255, 0.95);
  --neon:          #ffffff;

  --ok:   #4ade80;   /* online  */
  --warn: #fbbf24;   /* partial */
  --bad:  #f87171;   /* offline / error */
}

/* ── BASE ────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button { background: none; border: none; cursor: pointer; font: inherit; color: inherit; }

body {
  font-family: ui-monospace, 'Cascadia Code', 'Fira Code', monospace;
  font-size: 13px;
  min-height: 100vh;
  color: var(--text);
}

/* ── BACKGROUND ──────────────────────────────────────────────────────────
   #bg is a fixed full-bleed layer behind everything and is always rendered.
   What it holds is the whole look of the page.

   Default: the auth-center backdrop — two soft radial pools over near-black,
   so a client built from this template lands on the same ground as the login
   page the user just came from.

   The blurred-photo variant is kept below, commented out. It is the starting
   point for a project that wants its own imagery: swap the two blocks and drop
   a background.webp next to this file. The frosted panels throughout the app
   (backdrop-filter) are built for it and work either way. */

html { background: #000; }
body { background: transparent; }

#bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%,    #1a1830 0%, transparent 65%),
    radial-gradient(ellipse at 100% 100%, #0f0e1e 0%, transparent 60%),
    #080810;
  z-index: -1;
}

/* blurred-image variant — see the note above
#bg {
  position: fixed;
  inset: -10%;
  background-image: url('/background.webp');
  background-size: cover;
  background-position: center;
  filter: blur(40px) brightness(0.75);
  transform: scale(1.1);
  z-index: -1;
}
*/

/* ── NAVBAR ─────────────────────────────────────────────────────────────── */

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}

.nav-tabs {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  padding: 5px;
  gap: 2px;
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
}

/* icon variant:
.tab {
  padding: 0 6px;
}
*/

.tab {
  background: transparent;
  border: none;
  border-radius: 20px;
  min-width: 44px;
  height: 44px;
  padding: 0 18px;
  color: rgba(255, 255, 255, 0.40);
  font-family: inherit;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.tab:hover { color: rgba(255, 255, 255, 0.75); }
.tab.active { background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.92); }

.profile-area { position: relative; }

.profile-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.50);
  color: rgba(255, 255, 255, 0.88);
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8), 0 2px 12px rgba(0, 0, 0, 0.4);
  transition: border-color .15s, color .15s;
}

.profile-btn:hover,
.profile-btn.open { border-color: rgba(255, 255, 255, 0.80); color: rgba(255, 255, 255, 1); }

.profile-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 256px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px;
  z-index: 101;
  display: none;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
}

.profile-popover.open { display: flex; }

.pi-info { display: flex; flex-direction: column; gap: 3px; }
.pi-label { font-size: 10px; color: rgba(255, 255, 255, 0.45); letter-spacing: .1em; text-transform: uppercase; }
.pi-name  { color: rgba(255, 255, 255, 0.92); word-break: break-all; }
.pi-sub   { font-size: 11px; color: rgba(255, 255, 255, 0.45); word-break: break-all; }

/* grouped action list: ONE rounded box, rows divided by hairlines */
.pi-list {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
}

.pi-action {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s;
}

/* divider only BETWEEN rows, never on the first one */
.pi-action + .pi-action { border-top: 1px solid rgba(255, 255, 255, 0.10); }

.pi-action:hover { background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.95); }

.pi-logout       { color: #ff9f9f; }
.pi-logout:hover { color: #ffbfbf; background: rgba(255, 80, 80, 0.12); }

/* ── LOGIN ───────────────────────────────────────────────────────────────── */

.login-screen {
  position: relative;
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 24px 20px;
}

.login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1;
  pointer-events: none;
}

/* card sits in the top flex zone, centered within it */
.login-card-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
  z-index: 2;
}

.login-card {
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  border-radius: 16px;
  padding: 44px 40px 36px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-align: center;
}

.login-logo {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .16em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.login-domain {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.40);
  text-decoration: none;
  letter-spacing: .04em;
  margin-bottom: 36px;
  transition: color .15s;
  display: block;
}

.login-domain:hover { color: rgba(255, 255, 255, 0.75); }

.login-btn {
  display: block;
  width: 100%;
  padding: 14px;
  margin-bottom: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.88);
  font-family: inherit;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .15s, border-color .15s, color .15s;
}

.login-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-active);
  color: rgba(255, 255, 255, 0.95);
}

/* app description under the login card */
.app-about {
  position: relative;
  z-index: 2;
  max-width: 380px;
  text-align: center;
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.40);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  padding-bottom: 20px;
}

.login-divider {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 380px;
  display: flex;
  align-items: center;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.login-divider-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  flex-shrink: 0;
  margin: 0 -1px; /* lines run flush to circle edge */
}

/* ── APP ─────────────────────────────────────────────────────────────────
   Logged-in content area + your app's own styles. Build here. */

.app-content {
  min-height: calc(100vh - 86px);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder {
  color: rgba(255, 255, 255, 0.92);
  font-size: 36px;
  letter-spacing: .2em;
  font-style: italic;
}

/* ── ERROR ───────────────────────────────────────────────────────────────── */

.error-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(70, 30, 30, .9);
  border: 1px solid #5c2e2e;
  border-radius: 10px;
  padding: 10px 16px;
  color: #e87a7a;
  font-size: 12px;
  z-index: 200;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  backdrop-filter: blur(8px);
}
