/* ============================================================
   PRIME LEDGER — shared.css
   CSS design tokens and base reset only.
   Every page links this, then defines its own layout styles.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Syne:wght@400;500;600;700&display=swap');

:root {
  --teal:   #0388A6;
  --navy:   #081F34;
  --bone:   #E1DFD9;
  --white:  #FFFFFF;
  --dark:   #060e1a;
  --card:   #0a1b2e;
  --mid:    #6b8a9e;
  --border: rgba(3, 136, 166, 0.15);
  --font:   'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--navy);
  color: var(--bone);
  overflow-x: hidden;
}

/* ─── AUTH OVERLAY ─── */
.auth-overlay {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background: var(--dark, #060e1a);
  overflow: hidden;
}
[data-theme="light"] .auth-overlay { background: #f0ede8; }

/* Animated grid lines */
.auth-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(3,136,166,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(3,136,166,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 30%, transparent 80%);
}
[data-theme="light"] .auth-grid {
  background-image:
    linear-gradient(rgba(3,136,166,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(3,136,166,0.06) 1px, transparent 1px);
}

/* Ambient glow orbs */
.auth-overlay-bg {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.auth-overlay-bg .ambient-orb {
  position: absolute; border-radius: 50%; filter: blur(140px);
  animation: auth-drift 25s ease-in-out infinite;
}
.auth-overlay-bg .ambient-orb:nth-child(1) {
  width: 600px; height: 600px; top: -20%; right: -5%;
  background: radial-gradient(circle, rgba(3,136,166,0.18) 0%, transparent 70%);
  animation-duration: 28s;
}
.auth-overlay-bg .ambient-orb:nth-child(2) {
  width: 500px; height: 500px; bottom: -10%; left: -10%;
  background: radial-gradient(circle, rgba(3,136,166,0.10) 0%, transparent 70%);
  animation-duration: 32s; animation-delay: -8s;
}
.auth-overlay-bg .ambient-orb:nth-child(3) {
  width: 350px; height: 350px; top: 60%; left: 55%;
  background: radial-gradient(circle, rgba(3,136,166,0.07) 0%, transparent 70%);
  animation-duration: 22s; animation-delay: -14s;
}
@keyframes auth-drift {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  33% { transform: translate(40px, -30px) scale(1.05); opacity: 0.7; }
  66% { transform: translate(-20px, 20px) scale(0.97); opacity: 0.4; }
}

/* Horizontal scan line */
.auth-scanline {
  position: absolute; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(3,136,166,0.25) 50%, transparent 100%);
  animation: auth-scan 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes auth-scan {
  0% { top: -2%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 102%; opacity: 0; }
}

/* Card */
.auth-card {
  position: relative; z-index: 1; text-align: center;
  padding: 3.5rem 3rem 2.5rem; max-width: 420px; width: 92%;
  background: rgba(10,27,46,0.85);
  border: 1px solid rgba(3,136,166,0.12);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 40px 80px rgba(0,0,0,0.4), 0 0 0 1px rgba(3,136,166,0.06) inset;
}
[data-theme="light"] .auth-card {
  background: rgba(234,231,226,0.9);
  border-color: rgba(3,136,166,0.15);
  box-shadow: 0 40px 80px rgba(0,0,0,0.08), 0 0 0 1px rgba(3,136,166,0.08) inset;
}

/* Glow ring at top of card */
.auth-card::before {
  content: '';
  position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal, #0388A6), transparent);
  border-radius: 2px;
}

/* Logo */
.auth-logo {
  height: 40px; margin-bottom: 0.75rem; opacity: 0.95;
}
[data-theme="light"] .auth-logo {
  filter: brightness(0) saturate(100%) invert(12%) sepia(30%) saturate(1200%) hue-rotate(180deg);
}

/* Site name */
.auth-site-name {
  font-family: 'Syne', sans-serif;
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.25em; text-transform: uppercase;
  color: var(--teal, #0388A6);
  margin-bottom: 2rem;
}
.auth-site-name .auth-dot {
  display: inline-block; width: 4px; height: 4px;
  background: var(--teal, #0388A6); border-radius: 50%;
  vertical-align: middle; margin: 0 0.1em;
  box-shadow: 0 0 6px var(--teal, #0388A6);
}

/* Divider */
.auth-divider {
  width: 40px; height: 1px; margin: 0 auto 1.5rem;
  background: linear-gradient(90deg, transparent, var(--border, rgba(3,136,166,0.15)), transparent);
}

.auth-card h2 {
  font-size: 1.15rem; font-weight: 600; margin-bottom: 0.4rem;
  color: var(--bone, #E1DFD9);
}
.auth-card p {
  font-size: 0.78rem; color: var(--mid, #6b8a9e);
  margin-bottom: 2rem; line-height: 1.6;
}
#googleSignInBtn {
  display: flex; justify-content: center; margin-bottom: 1.25rem;
}
.auth-error {
  display: none; font-size: 0.75rem; color: #ef4444;
  margin-bottom: 0.75rem; padding: 0.5rem 0.75rem;
  background: rgba(239,68,68,0.08); border-radius: 6px;
}
.auth-domain-note {
  font-size: 0.6rem; color: var(--mid, #6b8a9e);
  letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
  opacity: 0.45;
}

/* ─── NAV USER BADGE ─── */
.user-badge {
  display: none; align-items: center; gap: 0.5rem;
  margin-left: 0.5rem;
}
.user-badge.visible { display: flex; }
.user-photo {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--border, rgba(3,136,166,0.15));
}
.user-info {
  position: relative; display: flex; align-items: center;
  cursor: pointer;
}
.user-name {
  font-size: 0.68rem; font-weight: 500;
  color: var(--bone, #E1DFD9);
  max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: opacity 0.25s, transform 0.25s;
}
.sign-out-label {
  position: absolute; left: 0;
  font-size: 0.68rem; font-weight: 600; color: #ef4444;
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap; pointer-events: none;
  background: none; border: none; cursor: pointer;
  font-family: var(--font, 'Inter', sans-serif); padding: 0;
}
.user-info:hover .user-name { opacity: 0; transform: translateY(-4px); }
.user-info:hover .sign-out-label { opacity: 1; transform: translateY(0); pointer-events: auto; }

@media (max-width: 768px) {
  .user-info { display: none; }
  .auth-card { padding: 2rem 1.5rem; }
}
