/* ============================================================================= */
/*                                                                             */
/* JWT PICKLEBALL OS - AUTHENTICATION PATTERN STYLES                           */
/*                                                                             */
/* FILE LOCATION:  /public/assets/css/auth/auth.css                            */
/*                                                                             */
/* FILE PURPOSE:                                                               */
/*   Provides the elite-level visual styling for the split-screen auth pattern.*/
/*   Implemented strictly using the Token-Based UI System constraints. Prevents*/
/*   color layering and z-index text washout bugs natively.                    */
/*                                                                             */
/* CHANGE LOG:                                                                 */
/*   - 14-08-2026 | UPGRADE: Added specific margin definitions to `.progress-steps` bounds isolating overlapping wizard text seamlessly. | Just Wonderful Things */
/*   - 12-04-2026 | CRITICAL FIX: Decoupled Footer Text Color styling completely via the new `--auth-text-footer` token isolating modifications natively. | Just Wonderful Things */
/*   - 12-04-2026 | UPGRADE: Added `.auth-block` CSS Variables ensuring global */
/*                  text color overrides propagate perfectly.                  */
/*   - 12-04-2026 | CRITICAL FIX: Enforced strict `.auth-bg-mode-*` logic to   */
/*                  isolate CSS Gradients, WebGL Canvases, and Static Colors   */
/*                  flawlessly without conflicting backgrounds.                */
/*   - 12-04-2026 | UPGRADE: Implemented CSS Grid-based Content Stacking to    */
/*                  completely eliminate layout shift (flash) during block     */
/*                  rotation natively. All transitions are now perfectly cross-*/
/*                  faded via GPU-accelerated opacity & transform layers.      */
/*                                                                             */
/* OWNERSHIP:                                                                  */
/*   - Team: Just Wonderful Things                                                     */
/*   - Contact: pickleballos@justwonderfulthings.com                           */
/*                                                                             */
/* ============================================================================= */

/* ----------------------------------------------------------------------------- */
/* Token Mapping & Layout Base                                                   */
/* ----------------------------------------------------------------------------- */

[data-theme="auth"] {
  --auth-text-primary: var(--color-text-primary, #FFFFFF);
  --auth-text-secondary: var(--color-text-secondary, rgba(255,255,255,0.7));
  --auth-text-muted: var(--color-text-muted, rgba(255,255,255,0.5));
  --auth-text-role: rgba(255,255,255,0.4);
  --auth-text-footer: rgba(255,255,255,0.6);
  --auth-bg-base: var(--color-bg-primary, #1E1B4B);
  --auth-accent: var(--color-accent, #A78BFA);
  --auth-transition-speed: 600ms;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(400px, 45%) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ----------------------------------------------------------------------------- */
/* Left Panel — Layering & WebGL Base                                            */
/* ----------------------------------------------------------------------------- */

.auth-layout__panel--brand {
  position: relative;
  overflow: hidden;
  background: var(--auth-bg-base);
  z-index: 1;
}

.auth-bg-webgl {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Mouse moves tracked globally on document */
}

/* ── STRICT BACKGROUND MODE ISOLATION ── */

/* 1. WebGL Mode: Show canvas, hide CSS gradient fallbacks */
body.auth-bg-mode-webgl .auth-bg-webgl {
  display: block;
}
body.auth-bg-mode-webgl .auth-layout__panel--brand::before,
body.auth-bg-mode-webgl .auth-layout__panel--brand::after {
  display: none !important;
}

/* 2. CSS Mode: Hide canvas, show CSS gradients and noise */
body.auth-bg-mode-css .auth-bg-webgl {
  display: none !important;
}
body.auth-bg-mode-css .auth-layout__panel--brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, var(--auth-accent), transparent 40%),
              radial-gradient(circle at 80% 70%, var(--auth-bg-base), transparent 40%);
  animation: authGradientFloat 18s ease-in-out infinite alternate;
  z-index: 1;
}
body.auth-bg-mode-css .auth-layout__panel--brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('/public/assets/images/noise.png');
  opacity: 0.05;
  z-index: 1;
  pointer-events: none;
}

/* 3. Off Mode (Static Color): Hide canvas AND CSS animations */
body.auth-bg-mode-off .auth-bg-webgl,
body.auth-bg-mode-off .auth-layout__panel--brand::before,
body.auth-bg-mode-off .auth-layout__panel--brand::after {
  display: none !important;
}

@keyframes authGradientFloat {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(-2%, 2%); }
  100% { transform: translate(2%, -2%); }
}

/* ----------------------------------------------------------------------------- */
/* Brand Typography & Central Composition                                        */
/* ----------------------------------------------------------------------------- */

.auth-brand {
  position: relative;
  z-index: 10; /* Fixed layer stacking washout */
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 64px 72px;
  color: var(--auth-text-primary);
}

/* Prevent accidental overrides from layout classes */
.auth-brand * {
  color: inherit;
}

.auth-brand__top {
  margin-bottom: 48px;
}

.auth-logo {
  max-height: 40px;
  display: block;
  opacity: 0;
  transform: translateY(10px);
  animation: authFadeIn var(--auth-transition-speed) ease forwards;
}

.auth-brand__content {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(20px);
  animation: authFadeIn var(--auth-transition-speed) ease forwards 150ms;
}

.auth-brand__footer {
  margin-top: auto;
  font-size: var(--font-sm);
  color: var(--auth-text-footer); /* Decoupled from generic secondary text */
}

.auth-brand__footer * {
  color: var(--auth-text-footer); /* Hard enforce over inheritance rule */
}

@keyframes authFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----------------------------------------------------------------------------- */
/* Content Rotation Blocks & Transition Behaviors                                */
/* ----------------------------------------------------------------------------- */

.auth-content {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  width: 100%;
}

[data-item] {
  grid-area: 1 / 1; /* Stack all items natively in the exact same cell */
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  --block-title-color: var(--auth-text-primary);
  --block-subtitle-color: var(--auth-text-secondary);
  --block-meta-color: var(--auth-text-muted);
  --block-role-color: var(--auth-text-role);
}

[data-item].active {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
}

/* Behavior 1: Fade */
.transition-fade [data-item] {
  transition: opacity var(--auth-transition-speed) ease, transform var(--auth-transition-speed) ease;
}

/* Behavior 2: Slide Up */
.transition-slide-up [data-item] {
  transform: translateY(30px);
  transition: opacity var(--auth-transition-speed) ease, transform var(--auth-transition-speed) cubic-bezier(0.16, 1, 0.3, 1);
}
.transition-slide-up [data-item].active {
  transform: translateY(0);
}

/* Behavior 3: Slide Down */
.transition-slide-down [data-item] {
  transform: translateY(-30px);
  transition: opacity var(--auth-transition-speed) ease, transform var(--auth-transition-speed) cubic-bezier(0.16, 1, 0.3, 1);
}
.transition-slide-down [data-item].active {
  transform: translateY(0);
}

/* Behavior 4: Zoom */
.transition-zoom [data-item] {
  transform: scale(0.95);
  transition: opacity var(--auth-transition-speed) ease, transform var(--auth-transition-speed) cubic-bezier(0.16, 1, 0.3, 1);
}
.transition-zoom [data-item].active {
  transform: scale(1);
}

/* Testimonial Block */
.auth-quote p {
  color: var(--block-title-color);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 1rem 0;
}

.auth-quote cite {
  color: var(--block-meta-color);
  font-style: normal;
  font-size: 1rem;
  display: block;
}

.auth-quote cite .author-role {
  color: var(--block-role-color);
}

/* Feature Block */
.auth-feature h2 {
  color: var(--block-title-color);
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  line-height: var(--line-height-tight);
}

.auth-feature p {
  color: var(--block-subtitle-color);
  font-size: 1.1rem;
  margin: 0;
  line-height: var(--line-height-relaxed);
}

/* Stats Block */
.auth-stats strong {
  display: block;
  color: var(--block-title-color);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.auth-stats span {
  color: var(--block-subtitle-color);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Campaign Block */
.auth-campaign h2 {
  color: var(--block-title-color);
}
.auth-campaign p {
  color: var(--block-subtitle-color);
}

/* ----------------------------------------------------------------------------- */
/* Right Panel — Form Layout                                                     */
/* ----------------------------------------------------------------------------- */

.auth-layout__panel--form {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-12) var(--space-8);
  background-color: var(--color-bg-page);
  overflow-y: auto;
  height: 100vh;
}

.auth-form-wrap {
  width: 100%;
  max-width: 400px;
  margin: auto;
  flex-shrink: 0;
}

/* Form Structural Consistency */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.auth-form__header {
  margin-bottom: var(--space-8);
}

.auth-form__title {
  font-size: var(--font-3xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-2);
}

.auth-form__subtitle {
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
  margin: 0;
}

.auth-form__link {
  color: var(--color-text-link);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
}

.auth-form__link:hover {
  text-decoration: underline;
}

.auth-form__back-link {
  margin-top: var(--space-6);
  text-align: center;
  font-size: var(--font-sm);
}

.auth-mobile-brand {
  display: none;
  margin-bottom: var(--space-8);
  width: 100%;
  justify-content: center;
}

.auth-mobile-brand .auth-brand-img {
  max-height: 48px;
  margin: 0 auto;
}

.auth-fallback-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.auth-fallback-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-brand);
  color: var(--color-text-inverse);
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.auth-fallback-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

/* ----------------------------------------------------------------------------- */
/* Progress Steps Spacing Adjustments                                            */
/* ----------------------------------------------------------------------------- */

.auth-form-wrap .progress-steps {
  margin-top: var(--space-4);
}

.auth-form-wrap .progress-steps > *:first-child {
  margin-bottom: var(--space-4);
}

/* ----------------------------------------------------------------------------- */
/* Mobile Behavior                                                               */
/* ----------------------------------------------------------------------------- */

@media (max-width: 768px) {
  .auth-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  
  .auth-layout__panel--brand {
    display: none !important;
  }
  
  .auth-layout__panel--form {
    align-items: flex-start;
    padding: var(--space-12) var(--space-6);
    overflow-y: visible;
  }
  
  .auth-mobile-brand {
    display: flex;
  }
}

/* ----------------------------------------------------------------------------- */
/* Workspace Chooser Cards                                                       */
/* ----------------------------------------------------------------------------- */

.workspace-card {
  width: 100%;
  background-color: var(--color-bg-surface);
  border: var(--border-width-thin) solid var(--border-color-default);
  border-radius: var(--radius-lg); 
  cursor: pointer;
  text-align: left;
  transition:
    transform var(--duration-normal) var(--ease-spring),
    box-shadow var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out),
    background-color var(--duration-normal) var(--ease-out);
}

.workspace-card .summary-card__title {
  transition: color var(--duration-normal) var(--ease-out);
}

.workspace-card .summary-card__trailing {
  transition: 
    transform var(--duration-normal) var(--ease-spring),
    color var(--duration-normal) var(--ease-out);
}

/* Multi-layered Premium Hover State */
.workspace-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-raised);
  border-color: var(--color-brand);
  background-color: var(--color-brand-subtle);
}

.workspace-card:hover .summary-card__title {
  color: var(--color-brand);
}

.workspace-card:hover .summary-card__trailing {
  transform: translateX(4px);
  color: var(--color-brand);
}

.workspace-card:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-color);
  outline-offset: 2px;
  box-shadow: var(--shadow-raised);
}

.workspace-card:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* ============================================================================= */
/* END AUTH MODULE STYLESHEET   /public/assets/css/auth/auth.css                 */
/* ============================================================================= */