/*!
 * E-Office Auth Pages — Wave 1
 * Spec: docs/superpowers/specs/2026-05-25-wave1-auth-pages-design.md
 * Scope: body.eo-ds.eo-auth (split-screen Login/TFA/SSO) + body.eo-ds .eo-myaccount-grid (MyAccount)
 * Loaded conditionally by class.Login.php / class.TwoFactorChallenge.php / class.LoginSsoMfa.php / class.MyAccount.php
 */
/* eo-auth:scaffold */

/* === 1. Split-screen layout (Login / TFA / SSO) === */
body.eo-ds.eo-auth {
  /* Cancel legacy body.login (application.css) flex+padding+gradient so the split-screen grid fills viewport */
  display: block;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  align-items: initial;
  justify-content: initial;
  background: var(--eo-surface);
}

body.eo-ds.eo-auth .eo-auth-grid {
  display: grid;
  grid-template-columns: 45% 55%;
  min-height: 100vh;
}

body.eo-ds.eo-auth .eo-auth-brand {
  position: relative;
  background: linear-gradient(135deg, var(--eo-primary) 0%, var(--eo-primary-900) 100%);
  color: #ffffff;
  padding: var(--eo-space-10);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body.eo-ds.eo-auth .eo-auth-brand::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 60%; height: 60%;
  background: radial-gradient(circle at 20% 20%, rgba(255,171,0,0.15), transparent 60%);
  pointer-events: none;
}
body.eo-ds.eo-auth .eo-auth-brand-logo {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--eo-space-3);
  margin-bottom: var(--eo-space-6);
}
body.eo-ds.eo-auth .eo-auth-brand-logo img {
  width: 60px; height: 60px;
  object-fit: contain;
  background: rgba(255,255,255,0.08);
  border-radius: var(--eo-radius-md);
  padding: 6px;
}
body.eo-ds.eo-auth .eo-auth-brand-name {
  font-family: var(--eo-font-sans);
  font-size: var(--eo-fs-lg);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  position: relative;
}
body.eo-ds.eo-auth .eo-auth-brand-name::after {
  content: '';
  display: block;
  width: 36px;
  height: 2px;
  background: var(--eo-accent);
  margin-top: 6px;
}
body.eo-ds.eo-auth .eo-auth-brand-tagline {
  position: relative;
  font-family: var(--eo-font-serif);
  font-size: 18px;
  line-height: var(--eo-lh-relaxed);
  color: rgba(255,255,255,0.92);
  max-width: 340px;
}
body.eo-ds.eo-auth .eo-auth-brand-footer {
  position: absolute;
  bottom: var(--eo-space-6);
  left: var(--eo-space-10);
  right: var(--eo-space-10);
  font-size: var(--eo-fs-xs);
  color: rgba(255,255,255,0.55);
}

body.eo-ds.eo-auth .eo-auth-panel {
  background: var(--eo-surface);
  padding: var(--eo-space-10);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
body.eo-ds.eo-auth .eo-auth-panel-inner {
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 768px) {
  body.eo-ds.eo-auth .eo-auth-grid { grid-template-columns: 1fr; }
  body.eo-ds.eo-auth .eo-auth-brand {
    min-height: 180px;
    flex-direction: row;
    align-items: center;
    gap: var(--eo-space-4);
    padding: var(--eo-space-5);
  }
  body.eo-ds.eo-auth .eo-auth-brand-logo { margin-bottom: 0; flex-shrink: 0; }
  body.eo-ds.eo-auth .eo-auth-brand-tagline { font-size: 14px; max-width: none; }
  body.eo-ds.eo-auth .eo-auth-brand-footer { display: none; }
  body.eo-ds.eo-auth .eo-auth-panel { padding: var(--eo-space-6) var(--eo-space-5); }
}

/* === 2. OTP 6-box widget === */
body.eo-ds .eo-otp-input {
  display: flex;
  gap: var(--eo-space-2);
  justify-content: center;
  margin: var(--eo-space-4) 0;
}
body.eo-ds .eo-otp-cell {
  width: 40px;
  height: 52px;
  text-align: center;
  font-family: var(--eo-font-mono);
  font-size: var(--eo-fs-2xl);
  font-weight: 700;
  color: var(--eo-text);
  background: var(--eo-surface);
  border: 1px solid var(--eo-border);
  border-radius: var(--eo-radius-md);
  padding: 0;
  transition: border-color var(--eo-dur-fast) var(--eo-ease),
              box-shadow var(--eo-dur-fast) var(--eo-ease),
              background var(--eo-dur-fast) var(--eo-ease);
}
body.eo-ds .eo-otp-cell:focus {
  outline: none;
  border-color: var(--eo-primary);
  box-shadow: var(--eo-shadow-focus);
}
body.eo-ds .eo-otp-cell.is-filled {
  background: var(--eo-primary-50);
  border-color: var(--eo-primary);
}

/* === 3. 2FA setup helpers === */
body.eo-ds .eo-secret-block {
  display: inline-flex;
  align-items: center;
  gap: var(--eo-space-2);
  padding: var(--eo-space-2) var(--eo-space-3);
  background: var(--eo-surface-alt);
  border: 1px solid var(--eo-border);
  border-radius: var(--eo-radius-md);
  font-family: var(--eo-font-mono);
  font-size: var(--eo-fs-sm);
  letter-spacing: 0.06em;
}
body.eo-ds .eo-qr-frame {
  display: inline-block;
  padding: var(--eo-space-3);
  background: var(--eo-surface);
  border: 1px solid var(--eo-border);
  border-radius: var(--eo-radius-md);
}
body.eo-ds .eo-qr-frame img { display: block; }

/* === 4. MyAccount two-column dashboard === */
body.eo-ds .eo-myaccount-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--eo-space-5);
  max-width: 980px;
  margin: var(--eo-space-5) auto;
  padding: 0 var(--eo-space-4);
}

body.eo-ds .eo-profile-panel {
  background: linear-gradient(160deg, var(--eo-primary) 0%, var(--eo-primary-900) 100%);
  color: #ffffff;
  border-radius: var(--eo-radius-lg);
  box-shadow: var(--eo-shadow-md);
  padding: var(--eo-space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  align-self: start;
}

body.eo-ds .eo-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--eo-accent);
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--eo-font-serif);
  font-size: 32px;
  font-weight: 700;
  color: #ffffff;
  overflow: hidden;
  margin-bottom: var(--eo-space-3);
}
body.eo-ds .eo-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.eo-ds .eo-profile-name {
  font-family: var(--eo-font-serif);
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 var(--eo-space-2);
  line-height: var(--eo-lh-tight);
}

body.eo-ds .eo-profile-role {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(255,171,0,0.18);
  color: var(--eo-accent);
  border: 1px solid var(--eo-accent);
  border-radius: var(--eo-radius-sm);
  font-size: var(--eo-fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--eo-space-4);
}

body.eo-ds .eo-profile-meta {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--eo-space-4) 0;
  width: 100%;
  text-align: left;
}
body.eo-ds .eo-profile-meta li {
  display: flex;
  align-items: center;
  gap: var(--eo-space-2);
  padding: 4px 0;
  font-size: var(--eo-fs-sm);
  color: rgba(255,255,255,0.85);
}
body.eo-ds .eo-profile-meta li > i[data-lucide],
body.eo-ds .eo-profile-meta li > svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.85;
}

body.eo-ds .eo-profile-panel .eo-btn {
  width: 100%;
}

@media (max-width: 768px) {
  body.eo-ds .eo-myaccount-grid {
    grid-template-columns: 1fr;
    padding: 0 var(--eo-space-3);
  }
  body.eo-ds .eo-profile-panel {
    padding: var(--eo-space-4);
  }
}

/* === 5. Quota bar === */
body.eo-ds .eo-quota-bar {
  height: 8px;
  background: var(--eo-border-soft);
  border-radius: var(--eo-radius-pill);
  overflow: hidden;
  margin-top: var(--eo-space-2);
}
body.eo-ds .eo-quota-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--eo-primary) 0%, var(--eo-accent) 100%);
  transition: width var(--eo-dur-slow) var(--eo-ease);
}
body.eo-ds .eo-quota-bar-fill.is-warning {
  background: linear-gradient(90deg, var(--eo-warning) 0%, var(--eo-warning-700) 100%);
}
body.eo-ds .eo-quota-bar-fill.is-danger {
  background: linear-gradient(90deg, var(--eo-danger) 0%, var(--eo-danger-700) 100%);
}

/* === 6. Lucide icon sizing (auth pages) === */
body.eo-ds .eo-icon {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  flex-shrink: 0;
}
body.eo-ds .eo-input-prefix > i[data-lucide],
body.eo-ds .eo-input-prefix > svg {
  width: 16px;
  height: 16px;
}

/* TFA hero icon block (used in TwoFactorChallenge + LoginSsoMfa) */
body.eo-ds .eo-tfa-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--eo-primary-50);
  color: var(--eo-primary);
  margin-bottom: var(--eo-space-3);
}
body.eo-ds .eo-tfa-hero-icon i[data-lucide],
body.eo-ds .eo-tfa-hero-icon svg {
  width: 24px;
  height: 24px;
}

/* Password reveal toggle button positioning inside .eo-input-prefix wrapper */
body.eo-ds .eo-input-prefix .eo-password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px;
  width: auto;
  height: auto;
}

/* MyAccount section row helper (label left / value right within .eo-card-body) */
body.eo-ds .eo-row-kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--eo-space-3);
  padding: var(--eo-space-2) 0;
  font-size: var(--eo-fs-sm);
}
body.eo-ds .eo-row-kv + .eo-row-kv {
  border-top: 1px solid var(--eo-border-soft);
}
body.eo-ds .eo-row-kv-label { color: var(--eo-text-muted); }
body.eo-ds .eo-row-kv-value { color: var(--eo-text); font-weight: 500; }

/* === 7. MyAccount (Option A: KPI Dashboard + Tabs) === */
body.eo-ds .eo-myaccount-container {
  max-width: 980px;
  margin: 0 auto;
  padding: var(--eo-space-5) var(--eo-space-4);
}

body.eo-ds .eo-myaccount-hero {
  position: relative;
  background: linear-gradient(135deg, var(--eo-primary) 0%, var(--eo-primary-900) 100%);
  color: #ffffff;
  border-radius: var(--eo-radius-lg);
  padding: var(--eo-space-5) var(--eo-space-6);
  margin-bottom: var(--eo-space-5);
  display: flex;
  align-items: center;
  gap: var(--eo-space-4);
  overflow: hidden;
  box-shadow: var(--eo-shadow-md);
}
body.eo-ds .eo-myaccount-hero::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 240px; height: 100%;
  background: radial-gradient(circle at 80% 50%, rgba(255,171,0,0.15), transparent 60%);
  pointer-events: none;
}
body.eo-ds .eo-myaccount-hero-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--eo-accent);
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--eo-font-serif);
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
body.eo-ds .eo-myaccount-hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
body.eo-ds .eo-myaccount-hero-info { flex: 1; min-width: 0; position: relative; }
body.eo-ds .eo-myaccount-hero-name {
  font-family: var(--eo-font-serif);
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 2px;
  line-height: var(--eo-lh-tight);
}
body.eo-ds .eo-myaccount-hero-meta {
  font-size: var(--eo-fs-sm);
  color: rgba(255,255,255,0.85);
}
body.eo-ds .eo-myaccount-hero-role {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255,171,0,0.18);
  color: var(--eo-accent);
  border: 1px solid var(--eo-accent);
  border-radius: var(--eo-radius-sm);
  font-size: var(--eo-fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
  flex-shrink: 0;
}

/* 2×2 KPI grid */
body.eo-ds .eo-myaccount-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--eo-space-4);
  margin-bottom: var(--eo-space-5);
}
body.eo-ds .eo-stat-card {
  background: var(--eo-surface);
  border: 1px solid var(--eo-border);
  border-radius: var(--eo-radius-lg);
  box-shadow: var(--eo-shadow-sm);
  padding: var(--eo-space-4) var(--eo-space-5);
}
body.eo-ds .eo-stat-card-label {
  font-size: var(--eo-fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--eo-text-muted);
  font-weight: 700;
  margin-bottom: var(--eo-space-2);
}
body.eo-ds .eo-stat-card-value {
  font-family: var(--eo-font-serif);
  font-weight: 700;
  font-size: var(--eo-fs-2xl);
  color: var(--eo-text);
  line-height: var(--eo-lh-tight);
  margin-bottom: 2px;
}
body.eo-ds .eo-stat-card-hint {
  font-size: var(--eo-fs-sm);
  color: var(--eo-text-muted);
}

/* Tab panels — only active panel is visible */
body.eo-ds .eo-myaccount-panel { display: none; }
body.eo-ds .eo-myaccount-panel.is-active { display: block; }

/* Responsive */
@media (max-width: 768px) {
  body.eo-ds .eo-myaccount-hero {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: var(--eo-space-4);
  }
  body.eo-ds .eo-myaccount-hero-role { align-self: flex-start; }
  body.eo-ds .eo-myaccount-stats { grid-template-columns: 1fr; }
}
