:root {
  color-scheme: light;

  /* One Day BI brand tokens (from www.onedaybi.com) */
  --primary: #0078d4;       /* Azure blue */
  --primary-dark: #005a9e;
  --secondary: #1f2937;     /* Dark slate */
  --accent: #10b981;        /* Emerald */
  --dark: #111827;
  --text: #374151;
  --muted: #6b7280;
  --light: #f9fafb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --success: #047857;
  --error: #b42318;

  --ring: 0 0 0 3px rgba(0, 120, 212, 0.15);
  --shadow-card: 0 20px 45px rgba(17, 24, 39, 0.10);
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06);
  --radius: 0.75rem;

  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--light);
  color: var(--text);
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

h1, h2, h3 { color: var(--dark); font-weight: 700; line-height: 1.2; margin: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.brand-logo { width: 2.5rem; height: 2.5rem; object-fit: contain; }

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--primary);
}

.brand-divider {
  width: 1px;
  height: 1.4rem;
  background: var(--border-strong);
}

.brand-portal {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
}

.header-site-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.header-site-link:hover { color: var(--primary); }

/* ---------- Page ---------- */
.page {
  flex: 1;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: flex;
  align-items: center;
}

/* ---------- Auth layout (signed out) ---------- */
.auth-layout {
  width: 100%;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

body.is-signed-in .auth-layout { display: none; }

/* Hero / brand panel */
.hero-panel {
  position: relative;
  padding: 3rem 2.75rem;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-image:
    linear-gradient(135deg, rgba(31, 41, 55, 0.93) 0%, rgba(0, 120, 212, 0.82) 100%),
    url("./assets/hero-background.webp");
  background-size: cover;
  background-position: center;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 40px);
}

.hero-panel > * { position: relative; z-index: 1; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 700;
  color: #7fc4ff;
  margin: 0 0 1rem;
}

.hero-panel h1 {
  color: #fff;
  font-size: clamp(2rem, 3.2vw, 2.85rem);
  margin-bottom: 1rem;
}
.hero-panel h1 .accent { color: var(--accent); }

.lede {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 2rem;
  max-width: 28rem;
}

.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.1rem;
}

.feature-list li {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
}

.feature-list strong { color: #fff; font-weight: 600; }

.feature-icon {
  flex: none;
  margin-top: 0.3rem;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25);
}

/* Auth card */
.auth-card {
  padding: 3rem 2.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card-head { margin-bottom: 1.5rem; }
.auth-card-head h2 { font-size: 1.6rem; margin-bottom: 0.4rem; }
.auth-sub { margin: 0; color: var(--muted); font-size: 0.95rem; }

.stack { display: grid; gap: 1rem; }

.field { display: grid; gap: 0.4rem; }
.field-label { font-size: 0.85rem; font-weight: 600; color: var(--secondary); }

input {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 0.5rem;
  padding: 0.8rem 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input::placeholder { color: #9ca3af; }
input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }

.field-hint { margin: 0; font-size: 0.82rem; color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  padding: 0.8rem 1.5rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--secondary); }

.btn-ghost {
  background: transparent;
  color: var(--secondary);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--secondary); color: #fff; border-color: var(--secondary); }

.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.status { min-height: 1.25rem; margin-bottom: 1rem; font-size: 0.9rem; color: var(--muted); }
.status.success { color: var(--success); font-weight: 600; }
.status.error { color: var(--error); font-weight: 600; }

.auth-foot { margin: 1.75rem 0 0; font-size: 0.82rem; color: var(--muted); }

/* ---------- Viewer layout (signed in) ---------- */
.viewer-layout { width: 100%; display: grid; gap: 1.25rem; }

.viewer-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem 1.4rem;
}

.session-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--success);
  margin-bottom: 0.4rem;
}

.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.viewer-id h2 { font-size: 1.15rem; }
.viewer-client { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.9rem; }

.viewer-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.viewer-status { margin: 0; font-size: 0.85rem; color: var(--muted); }
.viewer-status.error { color: var(--error); }

.viewer-frame-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.client-page-frame {
  display: block;
  width: 100%;
  min-height: 75vh;
  border: 0;
  background: #fff;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--secondary);
  color: #fff;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.footer-brand { display: flex; align-items: center; gap: 0.75rem; }
.footer-logo { width: 2rem; height: 2rem; object-fit: contain; }
.footer-name { margin: 0; font-weight: 700; }
.footer-tag { margin: 0; font-size: 0.85rem; color: #cbd5e1; }
.footer-copy { margin: 0; font-size: 0.82rem; color: #cbd5e1; }

.hidden { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .auth-layout { grid-template-columns: 1fr; }
  .hero-panel { padding: 2.5rem 1.75rem; }
  .auth-card { padding: 2.25rem 1.75rem; }
  .page { padding: 1.5rem; }
  .brand-portal, .brand-divider { display: none; }
}

@media (max-width: 520px) {
  .viewer-bar { flex-direction: column; }
  .viewer-actions { width: 100%; justify-content: space-between; }
  .client-page-frame { min-height: 68vh; }
}
