/* ==================== ROOT VARIABLES ==================== */
:root {
  --gold: #d4af37;
  --gold-dark: #b8960f;
  --gold-light: rgba(212, 175, 55, 0.12);
  --gold-glow: rgba(212, 175, 55, 0.3);
  --black: #0a0a0a;
  --black-secondary: #1a1a1a;
  --dark-surface: #111111;
  --white: #ffffff;
  --white-off: #f8f9fa;
  --gray-100: #f1f3f5;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-600: #6c757d;
  --border-color: #e0e0e0;
  --transition-smooth: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1.2);
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.2);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
}

/* ==================== GLOBAL RESET ==================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--white-off);
  color: var(--black-secondary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  color: var(--black-secondary);
}

/* ==================== AUTH WRAPPER ==================== */
.auth-wrapper {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--white);
}

/* ==================== VISUAL SIDE (LEFT) ==================== */
.auth-visual {
  position: relative;
  flex: 0 0 50%;
  max-width: 50%;
  background: linear-gradient(160deg, #0a0a0a 0%, #1a1a1a 30%, #111111 60%, #0d0d0d 100%);
  overflow: hidden;
  display: none;
}

@media (min-width: 992px) {
  .auth-visual {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Gradient Layers */
.visual-gradient-layer {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

.layer-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.4) 0%, transparent 70%);
  top: -15%;
  left: -10%;
  animation-name: layerFloat1;
  animation-duration: 12s;
}

.layer-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.3) 0%, transparent 70%);
  bottom: -10%;
  right: -5%;
  animation-name: layerFloat2;
  animation-duration: 15s;
}

.layer-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, transparent 70%);
  top: 40%;
  left: 30%;
  animation-name: layerFloat3;
  animation-duration: 10s;
}

@keyframes layerFloat1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, 40px) scale(1.15); }
}

@keyframes layerFloat2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-40px, -50px) scale(1.2); }
}

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

/* Grid Pattern */
.visual-grid-pattern {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(212, 175, 55, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 175, 55, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 1;
}

/* Geometric Shapes */
.visual-shapes {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.shape {
  position: absolute;
  opacity: 0.6;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.shape svg {
  width: 100%;
  height: 100%;
}

.shape-1 { width: 120px; height: 138px; top: 8%; left: 10%; animation: shapeFloat 8s ease-in-out infinite; }
.shape-2 { width: 90px; height: 90px; top: 25%; right: 15%; animation: shapeFloat 10s ease-in-out infinite reverse; }
.shape-3 { width: 100px; height: 100px; bottom: 20%; left: 20%; animation: shapeFloat 9s ease-in-out infinite 2s; }
.shape-4 { width: 110px; height: 105px; top: 55%; right: 25%; animation: shapeFloat 7s ease-in-out infinite 1s; }
.shape-5 { width: 80px; height: 80px; bottom: 35%; left: 50%; animation: shapeFloat 11s ease-in-out infinite 3s; }

@keyframes shapeFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(10px, -15px) rotate(5deg); }
  50% { transform: translate(-5px, -25px) rotate(-3deg); }
  75% { transform: translate(-15px, -10px) rotate(2deg); }
}

/* Particles */
.visual-particles {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(212, 175, 55, 0.5);
  border-radius: 50%;
  animation: particleDrift linear infinite;
}

.particle-1 { top: 15%; left: 25%; animation-duration: 6s; }
.particle-2 { top: 30%; left: 60%; animation-duration: 8s; }
.particle-3 { top: 45%; left: 15%; animation-duration: 7s; }
.particle-4 { top: 60%; left: 70%; animation-duration: 9s; }
.particle-5 { top: 75%; left: 35%; animation-duration: 5s; }
.particle-6 { top: 20%; left: 80%; animation-duration: 10s; }
.particle-7 { top: 50%; left: 45%; animation-duration: 6.5s; }
.particle-8 { top: 85%; left: 55%; animation-duration: 8.5s; }
.particle-9 { top: 10%; left: 40%; animation-duration: 7.5s; }
.particle-10 { top: 70%; left: 10%; animation-duration: 9.5s; }

@keyframes particleDrift {
  0% { transform: translate(0, 0); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translate(40px, -80px); opacity: 0; }
}

/* Brand Content */
.visual-content {
  position: relative;
  z-index: 3;
  padding: 3rem;
  max-width: 480px;
}

.brand-showcase {
  animation: fadeInUp 0.8s ease-out;
}

.brand-icon-wrapper {
  position: relative;
  margin: 0 auto;
}

.brand-icon-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(212, 175, 55, 0.3);
  animation: ringPulse 2s ease-in-out infinite;
}

@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.1); opacity: 0.6; }
}

.brand-main-icon {
  font-size: 3.5rem;
  color: var(--gold);
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 20px rgba(212, 175, 55, 0.4));
}

.brand-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -1px;
}

.brand-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  font-weight: 400;
}

.brand-features {
  display: grid;
  gap: 1rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition-base);
}

.feature-item:hover {
  background: rgba(212, 175, 55, 0.08);
  border-color: rgba(212, 175, 55, 0.2);
  transform: translateX(5px);
}

.feature-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(212, 175, 55, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-icon-box i {
  font-size: 1.2rem;
  color: var(--gold);
}

.feature-text h6 {
  color: var(--white);
  font-size: 0.875rem;
}

.feature-text small {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
}

/* ==================== FORM SECTION (RIGHT) ==================== */
.auth-form-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--white-off);
  position: relative;
}

@media (min-width: 992px) {
  .auth-form-section {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 2.5rem;
  }
}

.form-scroll-container {
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

.form-card-wrapper {
  width: 100%;
  max-width: 500px;
}

/* Back Navigation */
.nav-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-600);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  transition: var(--transition-base);
  background: var(--white);
  border: 1px solid var(--gray-200);
}

.nav-back-link:hover {
  color: var(--black-secondary);
  background: var(--gray-100);
  transform: translateX(-4px);
  box-shadow: var(--shadow-sm);
}

/* Form Card */
.form-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  animation: fadeInUp 0.6s ease-out;
}

@media (max-width: 575.98px) {
  .form-card {
    padding: 1.75rem;
    border-radius: var(--radius-lg);
  }
}

/* Form Header */
.form-header {
  margin-bottom: 2rem;
}

.logo-animated {
  position: relative;
  display: inline-block;
  margin-bottom: 1rem;
}

.logo-img {
  width: auto;
  height: 100px;
  position: relative;
  z-index: 1;
  animation: logoBounce 3s ease-in-out infinite;
}

@keyframes logoBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.logo-glow {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.2) 0%, transparent 70%);
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.3); opacity: 0.8; }
}

.form-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--black-secondary);
  margin-bottom: 0.25rem;
}

.form-subtitle {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-bottom: 0;
}

/* ==================== INPUT GROUPS ==================== */
.form-floating-group {
  position: relative;
}

.input-icon-group {
  position: relative;
}

.input-leading-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  color: var(--gray-600);
  font-size: 1.2rem;
  transition: var(--transition-base);
  pointer-events: none;
}

.input-trailing-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  color: var(--gray-600);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition-base);
  padding: 4px;
  border-radius: 6px;
}

.input-trailing-icon:hover {
  color: var(--gold);
  background: var(--gold-light);
}

.form-control {
  padding: 0.85rem 1rem;
  font-size: 0.9375rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--white);
  transition: var(--transition-base);
  color: var(--black-secondary);
  height: auto;
}

.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
  outline: none;
}

.form-control:focus ~ .input-leading-icon {
  color: var(--gold);
}

.form-control::placeholder {
  color: transparent;
}

.floating-label {
  position: absolute;
  left: 2.8rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9375rem;
  color: var(--gray-600);
  pointer-events: none;
  transition: var(--transition-base);
  background: var(--white);
  padding: 0 4px;
}

.form-control:focus ~ .floating-label,
.form-control:not(:placeholder-shown) ~ .floating-label {
  top: 0;
  transform: translateY(-50%) scale(0.8);
  color: var(--gold);
  font-weight: 600;
}

.input-focus-border {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
  transition: var(--transition-smooth);
  border-radius: 0 0 var(--radius) var(--radius);
}

.form-control:focus ~ .input-focus-border {
  width: 100%;
  left: 0;
}

/* ==================== CUSTOM CHECKBOX ==================== */
.custom-checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.custom-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
}

.custom-checkbox-label {
  font-size: 0.8125rem;
  color: var(--gray-600);
  cursor: pointer;
  user-select: none;
}

/* ==================== FORGOT LINK ==================== */
.forgot-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
  transition: var(--transition-fast);
}

.forgot-link:hover {
  color: var(--gold-dark);
  text-decoration: underline;
}

/* ==================== BUTTONS ==================== */
.btn-primary-gradient {
  background: linear-gradient(135deg, var(--black-secondary), #2a2a2a);
  color: var(--white);
  border: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.btn-primary-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary-gradient:hover::before {
  opacity: 1;
}

.btn-primary-gradient:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--white);
}

.btn-primary-gradient .btn-text,
.btn-primary-gradient .btn-icon {
  position: relative;
  z-index: 1;
}

.btn-primary-gradient:active {
  transform: translateY(0) scale(0.98);
}

.btn-outline-dark {
  border: 2px solid var(--gray-300);
  color: var(--black-secondary);
  font-weight: 600;
  transition: var(--transition-base);
}

.btn-outline-dark:hover {
  background: var(--black-secondary);
  border-color: var(--black-secondary);
  color: var(--white);
  transform: translateY(-1px);
}

/* ==================== AUTH DIVIDER ==================== */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--gray-200);
}

.auth-divider span {
  padding: 0 1rem;
  font-size: 0.75rem;
  color: var(--gray-600);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ==================== SOCIAL BUTTONS ==================== */
.social-buttons-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.social-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-base);
  font-size: 1.2rem;
  color: var(--gray-600);
}

.social-btn:hover {
  border-color: var(--gold);
  background: var(--gold-light);
  color: var(--gold);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

/* ==================== FOOTER TEXT ==================== */
.form-footer-text {
  text-align: center;
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-top: 1.5rem;
  margin-bottom: 0;
}

.footer-link {
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-fast);
}

.footer-link:hover {
  color: var(--gold-dark);
  text-decoration: underline;
}

/* ==================== SUCCESS STATE ==================== */
.success-state {
  padding: 1rem 0;
  animation: fadeInUp 0.5s ease-out;
}

.success-icon-wrapper {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto;
}

.success-icon-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 3px solid #28a745;
  opacity: 0.2;
  animation: ringPulse 2s ease-in-out infinite;
}

.success-icon {
  font-size: 5rem;
  color: #28a745;
  position: relative;
  z-index: 1;
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== RESPONSIVE ==================== */

/* Mobile (Below 992px) */
@media (max-width: 991.98px) {
  .auth-wrapper {
    background: linear-gradient(160deg, #0a0a0a 0%, #1a1a1a 50%, #111111 100%);
    align-items: center;
    justify-content: center;
    padding: 1rem;
  }
  
  .auth-form-section {
    flex: 1;
    max-width: 100%;
    background: transparent;
    padding: 0;
  }
  
  .form-card {
    box-shadow: var(--shadow-xl);
    max-width: 420px;
    margin: 0 auto;
  }
  
  .nav-back-link {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
  }
  
  .nav-back-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
  }
}

/* Small Mobile */
@media (max-width: 575.98px) {
  .auth-form-section {
    padding: 0.75rem;
  }
  
  .form-card {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
  }
  
  .form-title {
    font-size: 1.5rem;
  }
  
  .form-control {
    font-size: 0.875rem;
    padding: 0.75rem 0.875rem;
    padding-left: 2.5rem;
  }
  
  .btn-lg {
    font-size: 0.9375rem;
    padding: 0.75rem 1.25rem;
  }
}

/* ==================== SCROLLBAR ==================== */
.form-scroll-container::-webkit-scrollbar {
  width: 4px;
}

.form-scroll-container::-webkit-scrollbar-track {
  background: transparent;
}

.form-scroll-container::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 10px;
}

/* ==================== ACCESSIBILITY ==================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: high) {
  .form-card {
    border: 2px solid #000;
  }
  
  .form-control {
    border: 2px solid #000;
  }
}

/* ==================== iOS SAFARI FIXES ==================== */
@supports (-webkit-touch-callout: none) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
  
  .auth-wrapper {
    min-height: -webkit-fill-available;
  }
}

/* ==================== PRINT ==================== */
@media print {
  .auth-visual {
    display: none !important;
  }
  
  .auth-form-section {
    flex: 1;
    max-width: 100%;
  }
}