/* ==========================================================================
   LucentraCode Modern 50/50 Authentication Stylesheet
   Pure White Form Partition + Blank Video Side
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  
  /* Right Side (Graphite Aurora Theme) */
  --auth-bg-white: #0C0F15;
  --auth-text-title: #F3F6FA;
  --auth-text-body: #929CAB;
  --auth-text-muted: #768396;
  --auth-text-dim: #4B5563;
  
  --auth-border: rgba(255, 255, 255, 0.08);
  --auth-border-hover: rgba(255, 255, 255, 0.16);
  --auth-border-focus: #EA4663;
  
  --auth-input-bg: #11151C;
  --auth-input-focus-bg: #161B24;
  
  --auth-primary-btn: #EA4663;
  --auth-primary-btn-hover: #F45875;
  --auth-primary-btn-text: #ffffff;
  
  --auth-accent: #EA4663;
  --auth-accent-soft: rgba(234, 70, 99, 0.15);
  
  --auth-error-bg: rgba(255, 107, 122, 0.1);
  --auth-error-border: rgba(255, 107, 122, 0.25);
  --auth-error-text: #FF6B7A;

  /* Left Side (Video Canvas) */
  --auth-video-bg: #07080b;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  width: 100%;
  height: 100vh;
  height: -webkit-fill-available;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}

body {
  height: 100%;
  height: 100vh;
  height: -webkit-fill-available;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  width: 100%;
  font-family: var(--font-sans);
  background-color: var(--auth-bg-white);
  color: var(--auth-text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

/* Split-screen wrapper */
.auth-split-container {
  display: flex;
  height: 100%;
  height: 100vh;
  height: -webkit-fill-available;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}

/* --------------------------------------------------------------------------
   Left Partition: Video Canvas (50%)
   -------------------------------------------------------------------------- */
.auth-video-partition {
  flex: 0 0 50%;
  width: 50%;
  max-width: 50%;
  min-width: 0;
  height: 100%;
  height: 100vh;
  height: -webkit-fill-available;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  background-color: var(--auth-video-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: relative;
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* ==========================================================================
   Cinematic Dream-Dissolve Slideshow (Safari / Chrome / Edge Optimized)
   ========================================================================== */
.auth-slideshow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--auth-video-bg);
  z-index: 1;
  outline: none;
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-perspective: 1000px;
  perspective: 1000px;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Individual Slide Layers */
.auth-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1),
              visibility 1.2s;
  pointer-events: none;
  z-index: 1;
  will-change: opacity;
}

/* Active State: 100% razor-sharp focus, pristine pixel clarity */
.auth-slide.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 3;
}

/* Exiting State: Graceful dissolve underneath incoming slide */
.auth-slide.exiting {
  opacity: 0;
  visibility: visible;
  transition: opacity 1.2s cubic-bezier(0.25, 1, 0.5, 1),
              visibility 1.2s;
  z-index: 2;
}

.auth-slide picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.auth-slide .auth-cover-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  display: block;
}



/* Empty state / placeholder overlay on left side */
.auth-video-canvas-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(255, 51, 102, 0.04) 0%, rgba(7, 8, 11, 0.85) 100%);
}

.auth-video-canvas-placeholder .video-indicator-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Right Partition: Pure White Authentication Screen (50%)
   -------------------------------------------------------------------------- */
.auth-form-partition {
  flex: 1 1 50%;
  width: 50%;
  max-width: 50%;
  min-width: 0;
  height: 100%;
  height: 100vh;
  height: -webkit-fill-available;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  background-color: var(--auth-bg-white);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(16px, 2.5vh, 28px) clamp(24px, 4.5vw, 48px);
  overflow: hidden;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.auth-form-partition::-webkit-scrollbar {
  display: none;
}

.auth-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: clamp(10px, 1.8vh, 18px);
  flex-shrink: 0;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--auth-text-title);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.auth-brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  overflow: hidden;
  flex-shrink: 0;
}

.auth-brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.auth-brand-logo-wrap .auth-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

/* Dark mode (default on auth): Dark logo visible, light logo hidden */
.auth-brand-logo-wrap .logo-dark {
  display: block;
}
.auth-brand-logo-wrap .logo-light {
  display: none;
}

/* Light / White theme support */
[data-theme="white"] .auth-brand-logo-wrap .logo-dark,
[data-theme="light"] .auth-brand-logo-wrap .logo-dark {
  display: none;
}
[data-theme="white"] .auth-brand-logo-wrap .logo-light,
[data-theme="light"] .auth-brand-logo-wrap .logo-light {
  display: block;
}

.auth-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.auth-nav-link {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--auth-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-nav-link:hover {
  color: var(--auth-text-title);
}

/* Main Form Wrapper */
.auth-content-box {
  width: 100%;
  max-width: 620px;
  margin: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}

/* Segmented Tab Switcher (Sign in / Create account) */
.auth-segmented-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #11151C;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px;
  border-radius: 12px;
  margin-bottom: clamp(12px, 1.8vh, 20px);
  position: relative;
  flex-shrink: 0;
}

.auth-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 1.4vh, 13px) 20px;
  border-radius: 9px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  color: var(--auth-text-muted);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.auth-tab-btn.active {
  background: #1B212C;
  color: var(--auth-text-title);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.auth-tab-btn:hover:not(.active) {
  color: var(--auth-text-title);
}

/* Title & Subtitle */
.auth-heading {
  font-size: clamp(30px, 3.8vh, 38px);
  font-weight: 700;
  color: var(--auth-text-title);
  letter-spacing: -0.035em;
  margin-bottom: 6px;
  line-height: 1.2;
  flex-shrink: 0;
}

.auth-subheading {
  font-size: clamp(15px, 1.8vh, 17px);
  color: var(--auth-text-muted);
  margin-bottom: clamp(14px, 2vh, 22px);
  line-height: 1.5;
  flex-shrink: 0;
}

/* Error Alert */
.auth-error-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background-color: var(--auth-error-bg);
  border: 1px solid var(--auth-error-border);
  color: var(--auth-error-text);
  padding: 10px 16px;
  border-radius: 9px;
  font-size: 13.5px;
  margin-bottom: clamp(10px, 1.5vh, 16px);
  flex-shrink: 0;
}

.auth-error-banner svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.auth-error-req-id {
  display: block;
  font-size: 12px;
  color: #ef4444;
  margin-top: 3px;
  font-family: var(--font-mono);
}

/* Local Dev Instant Access Banner */
.auth-dev-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background-color: rgba(54, 214, 162, 0.08);
  border: 1px solid rgba(54, 214, 162, 0.25);
  padding: 8px 14px;
  border-radius: 9px;
  margin-bottom: clamp(10px, 1.5vh, 16px);
  flex-shrink: 0;
}

.auth-dev-label {
  font-size: 13px;
  font-weight: 600;
  color: #36D6A2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-dev-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #36D6A2;
  color: #080A0E !important;
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.auth-dev-btn:hover {
  background: #5ef3c3;
  transform: translateY(-1px);
}

/* Federated sign-in (Google, GitHub side-by-side) */
.auth-oauth-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 2px;
  flex-shrink: 0;
}

.auth-oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 52px;
  height: 52px;
  padding: 0 20px;
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  background: var(--auth-bg-white);
  color: var(--auth-text-title);
  font-family: var(--font-sans);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
  white-space: nowrap;
}

.auth-oauth-btn:hover {
  border-color: var(--auth-border-hover);
  background: var(--auth-input-bg);
  text-decoration: none;
}

.auth-oauth-btn:active {
  transform: scale(0.995);
}

.auth-oauth-btn:focus-visible {
  outline: 2px solid var(--auth-border-focus);
  outline-offset: 2px;
}

.auth-oauth-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin: clamp(14px, 2vh, 20px) 0 clamp(12px, 1.6vh, 16px);
  flex-shrink: 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--auth-border);
}

.auth-divider span {
  color: var(--auth-text-dim);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
}

/* Form Styles */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.8vh, 16px);
  flex-shrink: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--auth-text-title);
}

.form-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  height: clamp(48px, 5.6vh, 54px);
  padding: 0 18px;
  font-size: 16px;
  font-family: inherit;
  color: var(--auth-text-title);
  background-color: var(--auth-input-bg);
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s ease-in-out;
}

/* Microsoft Edge native password reveal icon suppression to prevent duplicate eye icons */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none;
  width: 0;
  height: 0;
}

/* Autofill styling normalization for Chrome, Safari, Edge */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0px 1000px var(--auth-input-bg) inset;
  -webkit-text-fill-color: var(--auth-text-title);
  transition: background-color 5000s ease-in-out 0s;
}

.form-input:focus {
  background-color: var(--auth-input-focus-bg);
  border-color: var(--auth-border-focus);
  box-shadow: 0 0 0 3px rgba(234, 70, 99, 0.18);
}

.form-input::placeholder {
  color: var(--auth-text-dim);
}

/* Password Visibility Toggle */
.password-toggle-btn {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  padding: 8px;
  color: var(--auth-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.password-toggle-btn:hover {
  color: var(--auth-text-title);
}

.form-field-hint {
  font-size: 12px;
  color: var(--auth-text-muted);
  line-height: 1.4;
  margin-top: 3px;
}

/* Submit Button */
.auth-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: clamp(48px, 6vh, 54px);
  background-color: var(--auth-primary-btn);
  color: var(--auth-primary-btn-text);
  border: none;
  border-radius: 10px;
  font-size: 16.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 6px;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.18s ease-in-out;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.auth-submit-btn:hover {
  background-color: var(--auth-primary-btn-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(234, 70, 99, 0.35);
}

.auth-submit-btn:active {
  transform: translateY(0);
}

.auth-submit-btn svg {
  transition: transform 0.15s ease;
}

.auth-submit-btn:hover svg {
  transform: translateX(2px);
}

/* Form Footer */
.auth-content-footer {
  margin-top: clamp(14px, 2vh, 20px);
  text-align: center;
  font-size: 15px;
  color: var(--auth-text-muted);
  flex-shrink: 0;
}

.auth-content-footer a {
  color: var(--auth-text-title);
  font-weight: 600;
  text-decoration: none;
}

.auth-content-footer a:hover {
  text-decoration: underline;
}

/* Bottom Copyright / Version */
.auth-page-footer {
  margin-top: clamp(10px, 1.6vh, 18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 12.5px;
  color: var(--auth-text-dim);
  flex-shrink: 0;
}

.auth-page-footer a {
  color: var(--auth-text-muted);
  text-decoration: none;
}

.auth-page-footer a:hover {
  color: var(--auth-text-title);
}

/* --------------------------------------------------------------------------
   Responsive Layout & Breakpoint System (Safari / Chrome / Edge)
   -------------------------------------------------------------------------- */

/* Medium Laptops & Desktops with high scaling (e.g. MacBook Air) */
@media (max-width: 1100px) and (min-width: 769px) {
  .auth-form-partition {
    padding: clamp(14px, 2.2vh, 24px) clamp(20px, 3.5vw, 36px);
  }
  .auth-content-box {
    max-width: 580px;
  }
}

/* Tablets & Mobile Portrait (max-width: 768px) */
@media (max-width: 768px) {
  .auth-split-container {
    flex-direction: column;
    height: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    overflow-y: auto;
  }
  
  .auth-video-partition {
    width: 100%;
    max-width: 100%;
    flex: 0 0 clamp(140px, 22vh, 200px);
    height: clamp(140px, 22vh, 200px);
    min-height: 140px;
    position: relative;
    top: auto;
  }
  
  .auth-form-partition {
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
    height: auto;
    min-height: auto;
    padding: 24px 20px;
    padding-top: max(14px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    overflow: visible;
  }

  .auth-content-box {
    max-width: 580px;
    margin: 0 auto;
    padding: 8px 0;
  }
}

/* Smartphones (max-width: 640px) */
@media (max-width: 640px) {
  .form-input {
    font-size: 16px; /* Prevents iOS Safari auto-zoom on focus */
    height: 50px;
  }
  
  .auth-heading {
    font-size: 28px;
    letter-spacing: -0.02em;
  }

  .auth-subheading {
    font-size: 15px;
    margin-bottom: 20px;
  }

  .auth-form-header {
    margin-bottom: 18px;
  }

  .auth-segmented-switch {
    margin-bottom: 20px;
  }

  .auth-submit-btn {
    height: 50px;
    font-size: 16px;
  }
}

/* Compact devices (e.g. iPhone SE, Galaxy Fold 320px-375px) */
@media (max-width: 380px) {
  .auth-video-partition {
    height: 120px;
    min-height: 120px;
    flex-basis: 120px;
  }

  .auth-form-partition {
    padding: 16px 12px;
  }

  .auth-heading {
    font-size: 22px;
  }

  .auth-tab-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* Fallback for ultra-short screens */
@media (max-height: 520px) {
  html, body, .auth-split-container, .auth-form-partition {
    overflow-y: auto !important;
  }

  .auth-split-container {
    height: auto !important;
    min-height: 100vh;
  }

  .auth-video-partition {
    height: 140px !important;
    min-height: 140px !important;
  }

  .auth-form-partition {
    height: auto !important;
    overflow-y: auto !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-oauth-btn {
    transition: none;
  }
  .auth-oauth-btn:active {
    transform: none;
  }
}
