/* Modern authentication page styles */
:root{
  --auth-bg-1: linear-gradient(135deg,#0f1724 0%, #071025 50%, #0c1220 100%);
  --card-bg: rgba(255,255,255,0.05);
  --card-border: rgba(255,255,255,0.1);
  --accent: #10b981; /* emerald */
  --muted: rgba(255,255,255,0.65);
  --gradient-primary: linear-gradient(135deg, #10b981, #3b82f6);
  --gradient-secondary: linear-gradient(135deg, #6366f1, #8b5cf6);
}

body.auth-page{
  background: var(--auth-bg-1);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, 'Helvetica Neue', Arial;
  position: relative;
  overflow-x: hidden;
}

/* Animated background elements */
body.auth-page::before{
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(16,185,129,0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(59,130,246,0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(99,102,241,0.05) 0%, transparent 50%);
  z-index: -1;
  animation: float 6s ease-in-out infinite;
}

/* Centering and container */
.auth-wrap{
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
}

.auth-card{
  width: 100%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

/* left panel: illustration */
.auth-illustration{
  background: linear-gradient(180deg,rgba(255,255,255,0.03),rgba(255,255,255,0.01));
  border-radius: 24px;
  padding: 3rem;
  border: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.auth-illustration::before{
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(16,185,129,0.05), rgba(59,130,246,0.05));
  border-radius: 24px;
  z-index: -1;
}

.auth-illustration h2{
  font-size: 2rem;
  margin-bottom: 0;
  color: white;
  font-weight: 700;
  background: linear-gradient(135deg, #10b981, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-illustration p{
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.1rem;
}

.auth-illustration img{
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}

.auth-illustration img:hover{
  transform: scale(1.02);
}

/* right panel: form */
.auth-panel{
  background: linear-gradient(180deg, rgba(17,24,39,0.8), rgba(7,10,23,0.8));
  border-radius: 24px;
  padding: 3rem;
  border: 1px solid var(--card-border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.auth-panel::before{
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(16,185,129,0.02), rgba(59,130,246,0.02));
  border-radius: 24px;
  z-index: -1;
}

.auth-brand{
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.auth-brand img{
  height: 48px;
  transition: transform 0.3s ease;
}

.auth-brand:hover img{
  transform: scale(1.05);
}

.form-title{
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: white;
}

.form-sub{
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.form-field{
  margin-bottom: 1.5rem;
}

.form-field label{
  display: block;
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-field input, 
.form-field select, 
.form-field textarea, 
.form-input{
  width: 100%;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: inherit;
  outline: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  font-size: 1rem;
}

.form-field input::placeholder{
  color: rgba(255,255,255,0.4);
}

.form-field input:focus, 
.form-field select:focus, 
.form-field textarea:focus, 
.form-input:focus{
  box-shadow: 0 0 0 3px rgba(16,185,129,0.2);
  border-color: rgba(16,185,129,0.5);
  background: rgba(255,255,255,0.08);
  transform: translateY(-1px);
}

.has-error .form-field input, 
.has-error .form-field select, 
.has-error .form-field textarea, 
.has-error .form-input{
  border-color: rgba(244,63,94,0.7);
  box-shadow: 0 0 0 3px rgba(244,63,94,0.1);
}

.field-errors{
  margin-top: 0.75rem;
  color: #fecaca;
  background: rgba(244,63,94,0.1);
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(244,63,94,0.2);
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
}

.help-text{
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  line-height: 1.5;
}

.password-wrap{
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap input{
  flex: 1;
  padding-right: 3rem;
}

.pw-toggle{
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
}

.pw-toggle:hover{
  background: rgba(255,255,255,0.1);
  color: white;
}

.pw-toggle svg{
  display: block;
  pointer-events: none;
  width: 20px;
  height: 20px;
}

.pw-toggle[aria-pressed="true"]{
  color: #10b981;
}

.pw-toggle.pw-visible svg{
  transform: rotate(20deg);
}

.primary-btn{
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  border-radius: 16px;
  background: var(--gradient-primary);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(16,185,129,0.2);
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  width: 100%;
  justify-content: center;
}

.primary-btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(16,185,129,0.3);
}

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

.secondary-btn{
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  border-radius: 16px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.secondary-btn:hover{
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.2);
  color: white;
}

.social-row{
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.social-btn{
  flex: 1;
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.social-btn:hover{
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

.auth-footer{
  margin-top: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-footer a{
  color: #10b981;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.auth-footer a:hover{
  color: #059669;
}

/* Loading states */
.loading{
  position: relative;
  overflow: hidden;
}

.loading::after{
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Responsive design */
@media (max-width: 1024px){
  .auth-card{
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .auth-illustration{
    order: 2;
    padding: 2rem;
  }
  
  .auth-panel{
    padding: 2rem;
  }
}

@media (max-width: 768px){
  .auth-wrap{
    padding: 1rem;
  }
  
  .auth-illustration{
    padding: 1.5rem;
  }
  
  .auth-panel{
    padding: 1.5rem;
  }
  
  .form-title{
    font-size: 1.5rem;
  }
  
  .auth-illustration h2{
    font-size: 1.75rem;
  }
}
