/* ============================================
   AUTH PAGES - Modern Redesign
   Login, Register, Password Reset, Profile, Settings
   ============================================ */

/* Auth Page Layout - Split Screen Design */
.auth-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Left Side - Branding/Visual */
.auth-visual {
  flex: 1;
  display: none;
  position: relative;
  overflow: hidden;
  padding: 60px;
}

@media (min-width: 992px) {
  .auth-visual {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

.auth-visual-content {
  position: relative;
  z-index: 2;
  color: #fff;
  max-width: 500px;
}

.auth-visual-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.auth-visual-logo img {
  height: 48px;
  width: auto;
}

.auth-visual-logo span {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.auth-visual h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.2;
}

.auth-visual p {
  font-size: 1.1rem;
  opacity: 0.9;
  line-height: 1.6;
  margin-bottom: 30px;
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-feature i {
  font-size: 1.3rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.auth-feature span {
  font-weight: 500;
}

/* Visual Background Elements */
.auth-visual::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  top: -100px;
  right: -100px;
  z-index: 1;
}

.auth-visual::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  bottom: -50px;
  left: -50px;
  z-index: 1;
}

/* Right Side - Form Container */
.auth-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--auth-bg, #f8fafc);
  min-height: 100vh;
}

@media (min-width: 992px) {
  .auth-form-side {
    max-width: 600px;
    border-radius: 40px 0 0 40px;
  }
}

/* Auth Card */
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  background: var(--auth-card-bg, #fff);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

@media (max-width: 576px) {
  .auth-card {
    padding: 28px 20px;
    border-radius: 20px;
  }
}

/* Mobile Logo (shown on mobile only) */
.auth-mobile-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

@media (min-width: 992px) {
  .auth-mobile-logo {
    display: none;
  }
}

.auth-mobile-logo img {
  height: 40px;
  width: auto;
}

.auth-mobile-logo span {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Auth Header */
.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: #fff;
  font-size: 1.75rem;
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--auth-title, #1f2937);
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--auth-text-muted, #6b7280);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Form Styles */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  position: relative;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--auth-label, #374151);
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
}

.input-wrapper i.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--auth-icon, #9ca3af);
  font-size: 1.1rem;
  z-index: 1;
  transition: color 0.2s ease;
}

.input-wrapper input {
  width: 100%;
  height: 52px;
  padding: 0 16px 0 48px;
  border: 2px solid var(--auth-border, #e5e7eb);
  border-radius: 12px;
  font-size: 0.95rem;
  background: var(--auth-input-bg, #f9fafb);
  color: var(--auth-text, #1f2937);
  transition: all 0.2s ease;
}

.input-wrapper input:focus {
  outline: none;
  border-color: #667eea;
  background: var(--auth-card-bg, #fff);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.input-wrapper input:focus ~ i.input-icon {
  color: #667eea;
}

.input-wrapper input::placeholder {
  color: var(--auth-placeholder, #9ca3af);
}

/* Password Toggle */
.password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--auth-icon, #9ca3af);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.password-toggle:hover {
  color: #667eea;
}

/* Remember Me & Forgot Password Row */
.auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--auth-text, #374151);
}

.remember-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid var(--auth-border, #d1d5db);
  cursor: pointer;
  accent-color: #667eea;
}

.forgot-link {
  font-size: 0.875rem;
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.forgot-link:hover {
  color: #5a67d8;
  text-decoration: underline;
}

/* Submit Button */
.btn-auth {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35);
}

.btn-auth:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.45);
}

.btn-auth:active {
  transform: translateY(0);
}

.btn-auth:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-auth .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Secondary Button */
.btn-auth-secondary {
  width: 100%;
  height: 52px;
  border: 2px solid var(--auth-border, #e5e7eb);
  border-radius: 12px;
  background: transparent;
  color: var(--auth-text, #374151);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-auth-secondary:hover {
  border-color: #667eea;
  color: #667eea;
  background: rgba(102, 126, 234, 0.05);
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--auth-text-muted, #9ca3af);
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--auth-border, #e5e7eb);
}

/* Footer Link */
.auth-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--auth-border, #e5e7eb);
  font-size: 0.9rem;
  color: var(--auth-text-muted, #6b7280);
}

.auth-footer a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  margin-left: 6px;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* Alert Messages */
.auth-alert {
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-alert i {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.auth-alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.auth-alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
}

.auth-alert-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #d97706;
}

.auth-alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #2563eb;
}

/* Password Strength Indicator */
.password-strength {
  margin-top: 10px;
}

.strength-bar {
  height: 4px;
  background: var(--auth-border, #e5e7eb);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.strength-fill {
  height: 100%;
  width: 0;
  transition: width 0.3s ease, background 0.3s ease;
  border-radius: 2px;
}

.strength-fill.weak { width: 25%; background: #ef4444; }
.strength-fill.fair { width: 50%; background: #f59e0b; }
.strength-fill.good { width: 75%; background: #22c55e; }
.strength-fill.strong { width: 100%; background: #16a34a; }

.strength-text {
  font-size: 0.75rem;
  color: var(--auth-text-muted, #6b7280);
}

/* ============================================
   PROFILE PAGE STYLES
   ============================================ */
.profile-page {
  padding: 40px 0;
  min-height: calc(100vh - 200px);
  background: var(--auth-bg, #f8fafc);
}

.profile-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.profile-header-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 24px;
  padding: 40px;
  color: #fff;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.profile-header-card::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  top: -100px;
  right: -50px;
}

.profile-header-content {
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
  z-index: 1;
}

.profile-avatar-large {
  width: 100px;
  height: 100px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  border: 4px solid rgba(255, 255, 255, 0.3);
  overflow: hidden;
}

.profile-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-info .email {
  opacity: 0.9;
  font-size: 0.95rem;
}

.profile-info .member-since {
  opacity: 0.7;
  font-size: 0.85rem;
  margin-top: 8px;
}

.profile-card {
  background: var(--auth-card-bg, #fff);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
}

.profile-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--auth-border, #e5e7eb);
}

.profile-card-header i {
  font-size: 1.5rem;
  color: #667eea;
}

.profile-card-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--auth-title, #1f2937);
  margin: 0;
}

.profile-form {
  display: grid;
  gap: 20px;
}

.profile-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.profile-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 16px;
  margin-top: 8px;
  border-top: 1px solid var(--auth-border, #e5e7eb);
}

/* Stats Cards */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--auth-card-bg, #fff);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.stat-card i {
  font-size: 1.75rem;
  color: #667eea;
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--auth-title, #1f2937);
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--auth-text-muted, #6b7280);
  margin-top: 4px;
}

/* ============================================
   SETTINGS PAGE
   ============================================ */
.settings-page {
  padding: 40px 0;
  min-height: calc(100vh - 200px);
  background: var(--auth-bg, #f8fafc);
}

.settings-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

.settings-header {
  margin-bottom: 32px;
}

.settings-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #667eea;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.settings-header .back-link:hover {
  gap: 12px;
}

.settings-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--auth-title, #1f2937);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.settings-header h1 i {
  color: #667eea;
}

.settings-header p {
  color: var(--auth-text-muted, #6b7280);
  margin: 0;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
}

.settings-card {
  background: var(--auth-card-bg, #fff);
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--auth-border, #e5e7eb);
  background: var(--auth-input-bg, #f9fafb);
}

.settings-card-header i {
  font-size: 1.25rem;
  color: #667eea;
}

.settings-card-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--auth-title, #1f2937);
  margin: 0;
}

.settings-card-body {
  padding: 24px;
}

.settings-form {
  display: grid;
  gap: 20px;
}

/* Info Rows */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--auth-border, #e5e7eb);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 0.9rem;
  color: var(--auth-text-muted, #6b7280);
}

.info-value {
  font-weight: 500;
  color: var(--auth-text, #374151);
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-badge.status-active {
  background: #dcfce7;
  color: #16a34a;
}

/* Password Strength Bar */
.password-strength-bar {
  height: 4px;
  background: var(--auth-border, #e5e7eb);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.password-strength-bar .strength-fill {
  height: 100%;
  width: 0;
  transition: width 0.3s ease, background 0.3s ease;
  border-radius: 2px;
}

.strength-fill.strength-weak { background: #ef4444; }
.strength-fill.strength-medium { background: #f59e0b; }
.strength-fill.strength-strong { background: #22c55e; }

.password-hint {
  color: var(--auth-text-muted, #6b7280);
  font-size: 0.8rem;
  margin-top: 6px;
  display: block;
}

/* Security Tips */
.security-tips-card .settings-card-header i {
  color: #f59e0b;
}

.security-tips {
  list-style: none;
  padding: 0;
  margin: 0;
}

.security-tips li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  color: var(--auth-text, #374151);
  font-size: 0.9rem;
}

.security-tips li i {
  color: #22c55e;
  margin-top: 2px;
}

/* Danger Zone */
.danger-zone-card .settings-card-header {
  background: #fef2f2;
}

.danger-zone-card .settings-card-header i {
  color: #dc2626;
}

.danger-zone-card .settings-card-header h2 {
  color: #991b1b;
}

.danger-text {
  color: var(--auth-text-muted, #6b7280);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.btn-danger-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 2px solid #dc2626;
  border-radius: 10px;
  color: #dc2626;
  background: transparent;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger-outline:hover:not(:disabled) {
  background: #dc2626;
  color: #fff;
}

.btn-danger-outline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.settings-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.settings-nav-item {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--auth-text-muted, #6b7280);
  background: var(--auth-input-bg, #f3f4f6);
  transition: all 0.2s ease;
}

.settings-nav-item:hover {
  color: #667eea;
}

.settings-nav-item.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

/* Settings Page Responsive */
@media (max-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
  
  .settings-header h1 {
    font-size: 1.5rem;
  }
}

/* ============================================
   DARK THEME SUPPORT
   ============================================ */
[data-theme="dark"] .auth-form-side,
.dark .auth-form-side {
  --auth-bg: #0f172a;
  --auth-card-bg: #1e293b;
  --auth-title: #f1f5f9;
  --auth-text: #e2e8f0;
  --auth-text-muted: #94a3b8;
  --auth-label: #cbd5e1;
  --auth-border: #334155;
  --auth-input-bg: #0f172a;
  --auth-icon: #64748b;
  --auth-placeholder: #64748b;
}

[data-theme="dark"] .profile-page,
.dark .profile-page {
  --auth-bg: #0f172a;
  --auth-card-bg: #1e293b;
  --auth-title: #f1f5f9;
  --auth-text: #e2e8f0;
  --auth-text-muted: #94a3b8;
  --auth-label: #cbd5e1;
  --auth-border: #334155;
  --auth-input-bg: #0f172a;
}

[data-theme="dark"] .settings-page,
.dark .settings-page {
  --auth-bg: #0f172a;
  --auth-card-bg: #1e293b;
  --auth-title: #f1f5f9;
  --auth-text: #e2e8f0;
  --auth-text-muted: #94a3b8;
  --auth-label: #cbd5e1;
  --auth-border: #334155;
  --auth-input-bg: #0f172a;
}

[data-theme="dark"] .status-badge.status-active,
.dark .status-badge.status-active {
  background: rgba(22, 163, 74, 0.2);
}

[data-theme="dark"] .danger-zone-card .settings-card-header,
.dark .danger-zone-card .settings-card-header {
  background: rgba(220, 38, 38, 0.1);
}

[data-theme="dark"] .auth-alert-error,
.dark .auth-alert-error {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.3);
}

[data-theme="dark"] .auth-alert-success,
.dark .auth-alert-success {
  background: rgba(22, 163, 74, 0.15);
  border-color: rgba(22, 163, 74, 0.3);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 576px) {
  .auth-header {
    margin-bottom: 24px;
  }
  
  .auth-icon {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
  }
  
  .auth-title {
    font-size: 1.5rem;
  }
  
  .auth-options {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .profile-header-content {
    flex-direction: column;
    text-align: center;
  }
  
  .profile-header-card {
    padding: 24px;
  }
  
  .profile-card {
    padding: 20px;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
.auth-card {
  animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-feature {
  animation: fadeInLeft 0.5s ease backwards;
}

.auth-feature:nth-child(1) { animation-delay: 0.1s; }
.auth-feature:nth-child(2) { animation-delay: 0.2s; }
.auth-feature:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
