/* =====================================================================
   ErgoFlow — css/shared-core167.css
   Design tokens + shared glass components used across every page.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root{
  /* ---- palette ---- */
  --bg:            #0a0b12;
  --bg-elevated:   #101220;
  --bg-soft:       #14162650;
  --violet:        #8b6eff;
  --violet-dim:    #8b6eff33;
  --cyan:          #56e0d6;
  --cyan-dim:      #56e0d633;
  --text:          #f3f1fa;
  --text-dim:      #a7a4bd;
  --text-faint:    #6c6a83;
  --danger:        #ff6b6b;
  --danger-dim:    #ff6b6b22;
  --success:       #59e8a0;

  /* ---- glass ---- */
  --glass-fill:    rgba(255,255,255,0.055);
  --glass-fill-hi: rgba(255,255,255,0.10);
  --glass-border:  rgba(255,255,255,0.14);
  --glass-border-hi: rgba(255,255,255,0.28);
  --glass-blur:    22px;
  --shadow-lg:     0 24px 60px -20px rgba(0,0,0,0.65);
  --shadow-sm:     0 8px 24px -12px rgba(0,0,0,0.5);

  /* ---- type ---- */
  --font-display: 'Sora', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* ---- layout ---- */
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --container: 1180px;
  --ease-flow: cubic-bezier(.22,.9,.25,1);
}

*, *::before, *::after{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient background field — soft violet/cyan glow, sits behind every page */
.bg-field{
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(760px 520px at 82% -8%, #8b6eff2e, transparent 60%),
    radial-gradient(680px 480px at -10% 30%, #56e0d622, transparent 60%),
    radial-gradient(900px 700px at 50% 120%, #8b6eff1c, transparent 65%),
    var(--bg);
}
.bg-noise{
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .035;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1,h2,h3,h4{
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

p{ margin: 0; color: var(--text-dim); }

a{ color: inherit; text-decoration: none; }

.eyebrow{
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before{
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
}

.container{
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------------------------------------------------------------------
   Glass primitives — the iOS "liquid glass" surface used everywhere
   --------------------------------------------------------------------- */
.glass{
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.08);
  position: relative;
}
.glass::before{
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, rgba(255,255,255,0.35), rgba(255,255,255,0) 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: .5;
}

.glass-panel{
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.08);
}

/* ---------------------------------------------------------------------
   Nav
   --------------------------------------------------------------------- */
.nav-wrap{
  position: sticky;
  top: 18px;
  z-index: 100;
  padding: 0 20px;
}
.nav{
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 12px 18px;
  border-radius: 999px;
}
.nav-brand{
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.nav-brand img{ width: 30px; height: 30px; border-radius: 9px; display: block; }
.nav-links{
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-links a{
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  transition: color .2s var(--ease-flow), background .2s var(--ease-flow);
}
.nav-links a:hover{ color: var(--text); background: var(--glass-fill-hi); }
.nav-actions{ display:flex; align-items:center; gap: 10px; }

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn{
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  padding: 12px 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .18s var(--ease-flow), box-shadow .18s var(--ease-flow), background .18s var(--ease-flow), opacity .18s var(--ease-flow);
  white-space: nowrap;
}
.btn:active{ transform: scale(0.97); }
.btn:disabled{ opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary{
  color: #0a0b12;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  box-shadow: 0 10px 30px -8px #8b6eff66;
}
.btn-primary:hover:not(:disabled){ box-shadow: 0 14px 36px -8px #8b6eff90; transform: translateY(-1px); }

.btn-glass{
  color: var(--text);
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
}
.btn-glass:hover:not(:disabled){ background: var(--glass-fill-hi); border-color: var(--glass-border-hi); }

.btn-ghost{
  color: var(--text-dim);
  background: transparent;
  padding: 12px 14px;
}
.btn-ghost:hover:not(:disabled){ color: var(--text); }

.btn-danger{
  color: var(--danger);
  background: var(--danger-dim);
  border: 1px solid #ff6b6b3d;
}
.btn-danger:hover:not(:disabled){ background: #ff6b6b33; }

.btn-block{ width: 100%; }
.btn-sm{ padding: 8px 14px; font-size: 13px; }

.btn-google{
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
}
.btn-google:hover:not(:disabled){ background: rgba(255,255,255,0.08); }
.btn-google img{ width: 18px; height: 18px; }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.field{ display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label{
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}
.field input{
  background: rgba(255,255,255,0.045);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-size: 14.5px;
  color: var(--text);
  font-family: var(--font-body);
  outline: none;
  transition: border-color .18s var(--ease-flow), background .18s var(--ease-flow);
}
.field input::placeholder{ color: var(--text-faint); }
.field input:focus{
  border-color: var(--cyan);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 4px #56e0d61f;
}
.field-error{
  font-size: 12.5px;
  color: var(--danger);
  min-height: 16px;
}

/* Focus visibility for accessibility, everywhere */
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible{
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------------------------------------------------------------------
   Alerts / toast
   --------------------------------------------------------------------- */
.alert{
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 14px;
  line-height: 1.45;
}
.alert.show{ display: flex; }
.alert-error{ background: var(--danger-dim); border: 1px solid #ff6b6b3d; color: #ffb3b3; }
.alert-success{ background: #59e8a01f; border: 1px solid #59e8a03d; color: var(--success); }

.toast{
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 999;
  padding: 13px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease-flow), transform .3s var(--ease-flow);
  max-width: 90vw;
  text-align: center;
}
.toast.show{ opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast-error{ color: #ffb3b3; }
.toast-success{ color: var(--success); }

/* ---------------------------------------------------------------------
   Loader / auth gate
   --------------------------------------------------------------------- */
.page-loader{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity .4s var(--ease-flow), visibility .4s var(--ease-flow);
}
.page-loader.hide{ opacity: 0; visibility: hidden; pointer-events: none; }
.loader-ring{
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid var(--glass-border);
  border-top-color: var(--cyan);
  animation: spin 0.8s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
footer.site-footer{
  padding: 60px 0 34px;
  margin-top: 80px;
}
.footer-grid{
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--glass-border);
}
.footer-brand{ display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.footer-brand img{ width: 26px; height: 26px; border-radius: 8px; }
.footer-tag{ margin-top: 10px; font-size: 13.5px; max-width: 320px; }
.footer-col h4{ font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); margin-bottom: 14px; }
.footer-col a{ display: block; font-size: 13.5px; color: var(--text-dim); padding: 6px 0; transition: color .18s; }
.footer-col a:hover{ color: var(--cyan); }
.footer-bottom{
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: space-between;
  align-items: center;
  padding-top: 22px;
  font-size: 12.5px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}
.footer-copy{ display: flex; flex-wrap: wrap; gap: 4px 14px; }

@media (max-width: 760px){
  .footer-grid{ grid-template-columns: 1fr; gap: 28px; }
  .nav-links{ display: none; }
}
