/* ============================================
   TIMBRATURE - Auth Pages Styles
   Modern, Clean, Professional Design
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --primary-dark: #0a1628;
  --primary-blue: #1e3a5f;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --surface-dark: rgba(30, 58, 95, 0.3);
  --surface-card: rgba(15, 35, 60, 0.8);
  --border-subtle: rgba(59, 130, 246, 0.2);
  --border-accent: rgba(6, 182, 212, 0.4);
  --gradient-primary: linear-gradient(135deg, #1e3a5f 0%, #0a1628 100%);
  --gradient-accent: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.15);
  --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Outfit', sans-serif;
}

body.auth-page {
  background: var(--gradient-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Animated Background Pattern */
body.auth-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(59, 130, 246, 0.05) 0%, transparent 30%);
  pointer-events: none;
  z-index: 0;
}

/* Geometric Pattern Overlay */
body.auth-page::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(59, 130, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}

.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  z-index: 1;
}

.auth-wrapper {
  width: 100%;
  max-width: 440px;
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Logo Section */
.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo-icon {
  width: 80px;
  height: 80px;
  background: var(--gradient-accent);
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.auth-logo-icon::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

.auth-logo-icon svg {
  width: 40px;
  height: 40px;
  fill: white;
  position: relative;
  z-index: 1;
}

.auth-logo h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}

.auth-logo p {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
}

/* Card Styles */
.auth-card {
  background: var(--surface-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 2.5rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-accent), transparent);
}

.auth-card-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-align: center;
}

.auth-card-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-align: center;
  margin-bottom: 2rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  letter-spacing: 0.3px;
}

.form-control {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-family: 'Outfit', sans-serif;
  background: var(--surface-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background: rgba(30, 58, 95, 0.5);
}

.form-control:hover:not(:focus) {
  border-color: var(--border-accent);
}

/* Checkbox Styles */
.form-check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.form-check-input {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--surface-dark);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.2s ease;
  position: relative;
}

.form-check-input:checked {
  background: var(--gradient-accent);
  border-color: transparent;
}

.form-check-input:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.form-check-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
}

/* Button Styles */
.btn-primary {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  background: var(--gradient-accent);
  border: none;
  border-radius: 12px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-secondary {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--surface-dark);
  border-color: var(--border-accent);
}

/* Links */
.auth-link {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.auth-link:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

.forgot-password {
  display: block;
  text-align: right;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 2rem 0;
  gap: 1rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.auth-divider span {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Register Section */
.register-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.register-section p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* Validation Messages */
.text-danger {
  color: #ef4444;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: block;
}

.validation-summary-errors {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.validation-summary-errors ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.validation-summary-errors li {
  color: #ef4444;
  font-size: 0.9rem;
}

/* Success Messages */
.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  color: #22c55e;
}

/* iOS Safe Areas */
@supports (padding: max(0px)) {
  .auth-container {
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
}

/* Responsive Design */
@media (max-width: 480px) {
  .auth-wrapper {
    max-width: 100%;
  }
  
  .auth-card {
    padding: 1.75rem;
    border-radius: 20px;
  }
  
  .auth-logo h1 {
    font-size: 1.75rem;
  }
  
  .auth-logo-icon {
    width: 70px;
    height: 70px;
  }
  
  .form-control {
    padding: 0.875rem 1rem;
  }
  
  .btn-primary,
  .btn-secondary {
    padding: 0.875rem 1.5rem;
  }
}

@media (min-width: 768px) {
  .auth-card {
    padding: 3rem;
  }
}

/* Touch Optimization */
@media (hover: none) and (pointer: coarse) {
  .btn-primary,
  .btn-secondary {
    min-height: 48px;
  }
  
  .form-control {
    min-height: 48px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .form-check-input {
    width: 24px;
    height: 24px;
  }
}

/* Dark Mode Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--primary-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-blue);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-up {
  animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Tab Navigation */
.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  background: var(--surface-dark);
  padding: 0.5rem;
  border-radius: 12px;
}

.auth-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.auth-tab.active {
  background: var(--gradient-accent);
  color: white;
}

.auth-tab:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.1);
}

/* Form Sections */
.auth-form-section {
  display: none;
}

.auth-form-section.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

/* Password Toggle */
.password-wrapper {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.password-toggle:hover {
  color: var(--text-primary);
}

.password-wrapper .form-control {
  padding-right: 3rem;
}

/* Loading State */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}





