/* ==========================================================================
   NEXORA Sliding Auth Portal CSS
   Dual-Theme: Ultra-Clean Formal Light Mode (Default) & Cyber Dark Mode
   Features:
   - Fullscreen Network Video Background (VIDEO.mp4)
   - Staggered Slow Graceful Entrance Animation ("Muncul secara perlahan")
   - Accurate 3D Sliding Transition with Morphing Curve (from LOGIN.mp4)
   - Pixel-Perfect Centering & Responsive Proportions
   ========================================================================== */

/* 1. CLEAN FORMAL LIGHT THEME (DEFAULT) */
:root, [data-theme="light"] {
  --auth-bg: #F1F5F9;
  --auth-card-bg: #FFFFFF;
  --auth-card-hover: #F8FAFC;
  --auth-border: #E2E8F0;
  --auth-border-glow: rgba(2, 132, 199, 0.3);

  --auth-cyan: #0284C7;
  --auth-cyan-glow: rgba(2, 132, 199, 0.25);
  --auth-blue: #2563EB;
  --auth-violet: #7C3AED;

  --auth-text: #0F172A;
  --auth-muted: #475569;
  --auth-dim: #64748B;

  --auth-input-bg: #F8FAFC;
  --auth-input-border: #CBD5E1;
  --auth-input-text: #0F172A;
  --auth-input-focus-bg: #FFFFFF;

  --auth-overlay-bg: linear-gradient(135deg, #0284C7 0%, #0EA5E9 45%, #06B6D4 100%);
  --auth-overlay-shadow: 0 10px 40px rgba(2, 132, 199, 0.35);

  --video-tint: radial-gradient(circle at 50% 50%, rgba(241, 245, 249, 0.2) 0%, rgba(241, 245, 249, 0.65) 60%, rgba(226, 232, 240, 0.9) 100%);

  --curve-size: 150px;
}

/* 2. CYBER DARK THEME */
[data-theme="dark"] {
  --auth-bg: #03050C;
  --auth-card-bg: rgba(9, 14, 28, 0.88);
  --auth-card-hover: rgba(18, 26, 48, 0.85);
  --auth-border: rgba(0, 240, 255, 0.25);
  --auth-border-glow: rgba(0, 240, 255, 0.35);

  --auth-cyan: #00F0FF;
  --auth-cyan-glow: rgba(0, 240, 255, 0.45);
  --auth-blue: #2563EB;
  --auth-violet: #7C3AED;

  --auth-text: #F8FAFC;
  --auth-muted: #94A3B8;
  --auth-dim: #64748B;

  --auth-input-bg: rgba(14, 22, 42, 0.75);
  --auth-input-border: rgba(255, 255, 255, 0.14);
  --auth-input-text: #FFFFFF;
  --auth-input-focus-bg: rgba(18, 30, 58, 0.92);

  --auth-overlay-bg: linear-gradient(135deg, #071E36 0%, #09385F 45%, #0A5580 80%, #0088A8 100%);
  --auth-overlay-shadow: 0 0 50px rgba(0, 240, 255, 0.3);

  --video-tint: radial-gradient(circle at 50% 50%, rgba(3, 7, 18, 0.25) 0%, rgba(3, 7, 18, 0.55) 60%, rgba(2, 4, 10, 0.88) 100%);
}

/* Page Body - Centered in Viewport */
.auth-page-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  height: 100vh;
  padding: 16px;
  position: relative;
  background-color: var(--auth-bg);
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  box-sizing: border-box;
  transition: background-color 0.3s ease;
}

/* ==========================================================================
   1. FULLSCREEN VIDEO BACKGROUND (VIDEO.mp4)
   ========================================================================== */
.video-background-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.bg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  opacity: 0.85;
  filter: brightness(0.9) contrast(1.15) saturate(1.25);
}

.video-overlay-tint {
  position: absolute;
  inset: 0;
  background: var(--video-tint);
  pointer-events: none;
  transition: background 0.3s ease;
}

/* Theme Toggle Button Floating on Auth Page */
.auth-theme-switch {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 100;
  background: var(--auth-card-bg);
  border: 1px solid var(--auth-border);
  color: var(--auth-muted);
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.25s ease;
}

.auth-theme-switch:hover {
  border-color: var(--auth-cyan);
  color: var(--auth-cyan);
  transform: translateY(-1px);
}

/* Ambient Floating Glow Accents */
.ambient-glow-1 {
  position: absolute;
  top: 6%;
  left: 10%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--auth-cyan-glow) 0%, transparent 65%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 1;
  animation: floatOrbOne 14s ease-in-out infinite alternate;
}

.ambient-glow-2 {
  position: absolute;
  bottom: 6%;
  right: 10%;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.18) 0%, transparent 65%);
  filter: blur(90px);
  pointer-events: none;
  z-index: 1;
  animation: floatOrbTwo 18s ease-in-out infinite alternate-reverse;
}

@keyframes floatOrbOne {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, 30px) scale(1.1); }
  100% { transform: translate(-30px, 60px) scale(0.95); }
}

@keyframes floatOrbTwo {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-60px, -40px) scale(1.15); }
  100% { transform: translate(30px, -50px) scale(0.9); }
}

/* ==========================================================================
   2. SLOWER, MORE NOTICEABLE STAGGERED ENTRANCE ANIMATION ("MUNCUL PERLAHAN")
   ========================================================================== */

/* Main Card Entrance */
.auth-container {
  animation: cardEntrance 0.95s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardEntrance {
  0% {
    opacity: 0;
    transform: translateY(35px) scale(0.95);
    filter: blur(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Noticeable, Elegant Staggered Item Appearance ("Muncul perlahan-lahan") */
.animate-item {
  opacity: 0;
  transform: translateY(22px);
  animation: itemFadeUp 1.05s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
}

@keyframes itemFadeUp {
  0% {
    opacity: 0;
    transform: translateY(22px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.delay-1 { animation-delay: 0.35s; }
.delay-2 { animation-delay: 0.65s; }
.delay-3 { animation-delay: 0.95s; }
.delay-4 { animation-delay: 1.25s; }
.delay-5 { animation-delay: 1.55s; }
.delay-6 { animation-delay: 1.85s; }
.delay-7 { animation-delay: 2.15s; }

/* ==========================================================================
   3. THE MAIN CARD (CLEAN FORMAL SHAPE & ELEVATED SHADOWS)
   ========================================================================== */
.auth-container {
  background: var(--auth-card-bg);
  border-radius: 28px;
  border: 1px solid var(--auth-border);
  box-shadow: 
    0 20px 60px -15px rgba(0, 0, 0, 0.12),
    0 0 35px var(--auth-cyan-glow),
    inset 0 1px 2px rgba(255, 255, 255, 0.35);
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 960px;
  height: 565px;
  max-height: calc(100vh - 32px);
  z-index: 10;
  transition: all 0.5s ease;
  margin: auto;
}

/* ==========================================================================
   4. FORM BOXES (CENTERED HORIZONTALLY & VERTICALLY)
   ========================================================================== */
.form-box {
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  z-index: 2;
  transition: all 0.75s cubic-bezier(0.77, 0, 0.175, 1);
  overflow-y: auto;
}

/* Sign In Box (Starts on the RIGHT, matching LOGIN.mp4) */
.sign-in-box {
  right: 0;
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
}

/* Sign Up Box (Starts on the LEFT, matching LOGIN.mp4) */
.sign-up-box {
  left: 0;
  opacity: 0;
  transform: translateX(-100%);
  pointer-events: none;
}

/* When in Register Mode */
.auth-container.right-panel-active .sign-in-box {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

.auth-container.right-panel-active .sign-up-box {
  transform: translateX(0);
  opacity: 1;
  pointer-events: all;
  z-index: 5;
}

.form-inner {
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.form-header {
  margin-bottom: 22px;
  width: 100%;
  text-align: center;
}

.form-header h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--auth-text);
  margin: 0 0 6px 0;
  letter-spacing: -0.025em;
  text-align: center;
}

.form-header p {
  font-size: 0.85rem;
  color: var(--auth-muted);
  line-height: 1.45;
  margin: 0 auto;
  max-width: 310px;
  text-align: center;
}

/* ==========================================================================
   5. SLIDING OVERLAY BANNER (MATCHING LOGIN.mp4 WITH MORPHING CURVE)
   ========================================================================== */
.overlay-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: visible;
  transition: transform 0.75s cubic-bezier(0.77, 0, 0.175, 1);
  z-index: 10;
  pointer-events: all;
}

.auth-container.right-panel-active .overlay-container {
  transform: translateX(100%);
}

.overlay {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--auth-overlay-bg);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 44px;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: var(--auth-overlay-shadow);
  transition: border-radius 0.75s cubic-bezier(0.77, 0, 0.175, 1);
}

/* Morphing Curve Shape from LOGIN.mp4 */
.overlay-curve-shape {
  border-radius: 0 var(--curve-size) var(--curve-size) 0;
}

.auth-container.right-panel-active .overlay-curve-shape {
  border-radius: var(--curve-size) 0 0 var(--curve-size);
}

/* Contour Glow along the curve */
.overlay::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 3px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.8), transparent);
  opacity: 0.7;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.9));
  transition: all 0.75s ease;
}

.auth-container.right-panel-active .overlay::after {
  right: auto;
  left: 0;
}

/* Overlay Panels (Swapping Content) */
.overlay-panel {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
  text-align: center;
  top: 0;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  transform: translateX(0);
  transition: transform 0.75s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.6s ease;
  z-index: 2;
}

.overlay-left-panel {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}

.overlay-right-panel {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-30%);
}

.auth-container.right-panel-active .overlay-left-panel {
  opacity: 0;
  pointer-events: none;
  transform: translateX(30%);
}

.auth-container.right-panel-active .overlay-right-panel {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}

.overlay-panel h2 {
  font-size: 2.1rem;
  font-weight: 800;
  color: #FFFFFF;
  margin: 0 0 12px 0;
  letter-spacing: -0.025em;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
}

.overlay-panel p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 26px 0;
  max-width: 320px;
}

/* Overlay Pill Switch Button from LOGIN.mp4 */
.btn-overlay-switch {
  background: transparent;
  border: 2px solid #FFFFFF;
  color: #FFFFFF;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 12px 36px;
  border-radius: 9999px;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.btn-overlay-switch:hover {
  background: #FFFFFF;
  color: var(--auth-cyan);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.7);
  transform: translateY(-2px) scale(1.04);
}

/* ==========================================================================
   6. FORM INPUTS & BUTTONS (CLEAN, FORMAL, MODERN)
   ========================================================================== */
.form-group-custom {
  position: relative;
  margin-bottom: 15px;
  width: 100%;
}

.input-box {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
}

.input-field {
  width: 100%;
  height: 48px;
  padding: 12px 16px 12px 44px;
  background: var(--auth-input-bg);
  border: 1px solid var(--auth-input-border);
  border-radius: 12px;
  color: var(--auth-input-text);
  font-size: 0.90rem;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.input-field:focus {
  outline: none;
  background: var(--auth-input-focus-bg);
  border-color: var(--auth-cyan);
  box-shadow: 0 0 0 3px var(--auth-cyan-glow);
}

.input-field::placeholder {
  color: var(--auth-dim);
  font-size: 0.86rem;
}

.input-icon-left {
  position: absolute;
  left: 14px;
  color: var(--auth-dim);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.25s ease;
}

.input-field:focus ~ .input-icon-left,
.input-box:focus-within .input-icon-left {
  color: var(--auth-cyan);
}

.input-icon-right {
  position: absolute;
  right: 14px;
  color: var(--auth-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.input-icon-right:hover {
  color: var(--auth-cyan);
}

.form-select-custom {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-select-custom option {
  background: var(--auth-card-bg);
  color: var(--auth-text);
}

/* Primary Action Submit Button */
.btn-auth-submit {
  width: 100%;
  height: 48px;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #FFFFFF;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.35s ease;
  box-shadow: 0 4px 18px rgba(2, 132, 199, 0.35);
  margin-top: 6px;
}

.btn-auth-submit:hover {
  background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%);
  box-shadow: 0 6px 25px rgba(2, 132, 199, 0.45);
  transform: translateY(-2px);
}

.btn-auth-submit:active {
  transform: translateY(0);
}

/* Extra Links */
.auth-extra-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  width: 100%;
  font-size: 0.85rem;
}

.auth-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--auth-muted);
  cursor: pointer;
  user-select: none;
}

.auth-checkbox-label input[type="checkbox"] {
  accent-color: var(--auth-cyan);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.auth-forgot-link {
  color: var(--auth-cyan);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.auth-forgot-link:hover {
  color: #0369A1;
  text-decoration: underline;
}

.security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 0.76rem;
  color: var(--auth-dim);
  letter-spacing: 0.02em;
}

.security-badge svg {
  color: #10B981;
}

/* Password Strength Meter */
.password-strength-wrap {
  margin-top: 4px;
  margin-bottom: 10px;
  width: 100%;
}

.password-strength-bar {
  height: 4px;
  width: 100%;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  width: 0%;
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* Mobile Responsiveness */
@media (max-width: 860px) {
  .auth-container {
    min-height: auto;
    border-radius: 24px;
    padding: 20px 0;
  }

  .form-box {
    position: relative;
    width: 100%;
    right: auto;
    left: auto;
    padding: 28px 20px;
    transform: none !important;
  }

  .sign-in-box {
    display: block;
  }

  .sign-up-box {
    display: none;
  }

  .overlay-container {
    display: none;
  }

  .auth-container.mobile-register .sign-in-box {
    display: none;
  }

  .auth-container.mobile-register .sign-up-box {
    display: block;
    opacity: 1;
    pointer-events: all;
  }
}
