/* ============================================
   AUTH PAGES - Login & Registration
   Premium UI for TAGLY authentication
   ============================================ */

:root {
  --auth-gradient-start: #0a0a0b;
  --auth-gradient-end: #1a1a1c;
  --auth-accent: #5233FF;
  --auth-accent-hover: #4129cc;
  --auth-glow: rgba(82, 51, 255, 0.15);
}

/* Auth Layout - Full Screen Gradient */
.auth-layout {
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height per mobile */
  display: flex;
  background: linear-gradient(135deg, var(--auth-gradient-start) 0%, var(--auth-gradient-end) 100%);
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.auth-layout::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, var(--auth-glow) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, var(--auth-glow) 0%, transparent 50%);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}

/* Left Panel - Brand Hero */
.auth-brand {
  flex: 1;
  padding: 6rem 3rem 4rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.auth-brand__content {
  position: relative;
  z-index: 1;
  max-width: 480px;
  padding-top: 2rem;
}

.auth-brand__logo {
  position: fixed;
  top: 2rem;
  left: 2rem;
  z-index: 100;
}

.auth-brand__logo img {
  height: 40px;
  width: auto;
  filter: brightness(1.1);
}

@media (max-width: 640px) {
  .auth-brand__logo {
    position: static;
    margin: 0 auto 2rem;
    text-align: center;
  }
  
  .auth-brand__logo img {
    height: 32px;
  }
}

.auth-brand__headline {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 1rem 0;
  line-height: 1.2;
  opacity: 0;
  animation: fadeInSlide 400ms ease-out 100ms forwards;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-brand__subheadline {
  font-size: 1.25rem;
  color: #999;
  margin: 0 0 3rem 0;
  line-height: 1.5;
  opacity: 0;
  animation: fadeInSlide 400ms ease-out 250ms forwards;
}

.auth-brand__benefits {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  opacity: 0;
  animation: fadeInSlide 400ms ease-out forwards;
}

.benefit-item:nth-child(1) { animation-delay: 400ms; }
.benefit-item:nth-child(2) { animation-delay: 500ms; }
.benefit-item:nth-child(3) { animation-delay: 600ms; }

.benefit-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--auth-accent);
}

.benefit-text {
  font-size: 1rem;
  color: #ccc;
  font-weight: 500;
}

/* Right Panel - Form Card */
.auth-form {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-secondary);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 300ms ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-card:hover {
  transform: translateY(-2px);
  transition: transform 0.3s ease;
}

.auth-card__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  text-align: center;
}

.auth-card__subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0 0 2rem 0;
  text-align: center;
}

/* Form Groups */
.auth-form-group {
  margin-bottom: 1.5rem;
}

.auth-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.auth-input-wrapper {
  position: relative;
}

.auth-input {
  width: 100%;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  transition: all 0.2s ease;
  font-family: inherit;
}

.auth-input:focus {
  outline: none;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px rgba(82, 51, 255, 0.1);
  background: var(--bg-secondary);
}

.auth-input:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.auth-input.error {
  border-color: var(--error-color);
}

.auth-input-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.auth-input-icon:hover {
  color: var(--text-primary);
}

.auth-error {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--error-color);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.auth-helper {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Error Banner */
.auth-error-banner {
  background: rgba(255, 59, 48, 0.1);
  border: 1px solid var(--error-color);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  color: var(--error-color);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: shake 400ms ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Checkbox Custom */
.auth-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.auth-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--auth-accent);
  cursor: pointer;
}

.auth-checkbox label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin: 0;
  line-height: 1.5;
}

.auth-checkbox label a {
  color: var(--auth-accent);
  text-decoration: none;
}

.auth-checkbox label a:hover {
  text-decoration: underline;
}

/* Buttons */
.auth-btn {
  width: 100%;
  background: var(--auth-accent);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.auth-btn:hover:not(:disabled) {
  background: var(--auth-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(82, 51, 255, 0.3);
}

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

.auth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-btn.loading {
  position: relative;
  color: transparent;
}

.auth-btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid white;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Footer Links */
.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  color: var(--auth-accent);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* Password Strength Meter */
.password-strength {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.25rem;
}

.strength-bar {
  flex: 1;
  height: 3px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  transition: background 0.3s ease;
}

.strength-bar.active {
  background: var(--error-color);
}

.strength-bar.active.medium {
  background: var(--warning-color);
}

.strength-bar.active.strong {
  background: var(--success-color);
}

.strength-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.375rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .auth-layout {
    flex-direction: column;
  }
  
  .auth-brand {
    padding: 3rem 2rem;
    min-height: auto;
  }
  
  .auth-brand__headline {
    font-size: 2rem;
  }
  
  .auth-brand__subheadline {
    font-size: 1rem;
    margin-bottom: 2rem;
  }
}

@media (max-width: 640px) {
  .auth-layout {
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height per mobile */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
  }
  
  .auth-brand {
    padding: 1.5rem 1rem 0.5rem;
    text-align: center;
    flex: 0 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .auth-brand__content {
    padding-top: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  
  .auth-brand__logo {
    position: static;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .auth-brand__logo img {
    height: 32px;
    width: auto;
  }
  
  .auth-brand__headline {
    display: none;
  }
  
  .auth-brand__subheadline {
    display: none;
  }
  
  /* Hide benefits on mobile */
  .auth-brand__benefits {
    display: none;
  }
  
  .auth-form {
    padding: 0.5rem 1rem 1rem;
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
  }
  
  .auth-card {
    width: 90%;
    max-width: 380px;
    padding: 2rem 1.5rem;
    margin: 0 auto;
  }
  
  .auth-card__title {
    font-size: 1.5rem;
  }
  
  .auth-card__subtitle {
    font-size: 0.875rem;
  }
}

