/**
 * Authentication Pages Styling
 * Login and Signup pages
 */

:root {
  --auth-primary: #007bff;
  --auth-primary-hover: #0056b3;
  --auth-secondary: #6c757d;
  --auth-danger: #dc3545;
  --auth-success: #28a745;
  --auth-bg: #ffffff;
  --auth-text: #333333;
  --auth-border: #e0e0e0;
  --auth-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --auth-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

/* Auth Body */
.auth-body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Auth Container */
.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  min-height: calc(100vh - 200px);
}

/* Auth Wrapper */
.auth-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  width: 100%;
  max-width: 1000px;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--auth-shadow-lg);
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Auth Content */
.auth-content {
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--auth-bg);
}

.auth-content.login-form {
  order: 1;
}

.auth-content.signup-form {
  order: -1;
}

/* Auth Header */
.auth-header {
  margin-bottom: 2rem;
  text-align: center;
}

.auth-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--auth-text);
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.5px;
}

.auth-header p {
  font-size: 1rem;
  color: var(--auth-secondary);
  margin: 0;
}

/* Auth Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Form Group Customizations */
.auth-form .form-group {
  display: flex;
  flex-direction: column;
}

.auth-form .form-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--auth-text);
  margin-bottom: 0.5rem;
  text-transform: none;
}

.auth-form .form-input,
.auth-form .form-checkbox {
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--auth-border);
  border-radius: 6px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.auth-form .form-input {
  background: #f8f9fa;
}

.auth-form .form-input:focus {
  background: white;
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
  outline: none;
}

.auth-form .form-input::placeholder {
  color: #999;
}

.auth-form .form-input.error {
  border-color: var(--auth-danger);
  background: #fff5f5;
}

.auth-form .form-text {
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Form Check (Checkbox) */
.auth-form .form-check {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.auth-form .form-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--auth-primary);
}

.auth-form .form-check label {
  cursor: pointer;
  margin: 0;
  font-weight: 500;
  color: var(--auth-text);
}

/* Links */
.link-primary {
  color: var(--auth-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.link-primary:hover {
  color: var(--auth-primary-hover);
  text-decoration: underline;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: var(--auth-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--auth-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 0.875rem 1.5rem;
  font-size: 1.1rem;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--auth-secondary);
  font-size: 0.9rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--auth-border);
}

/* Auth Footer */
.auth-footer {
  text-align: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--auth-border);
}

.auth-footer p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--auth-text);
}

.mb-0 {
  margin-bottom: 0;
}

/* Auth Illustration */
.auth-illustration {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  position: relative;
  overflow: hidden;
}

.auth-illustration::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: moveBackground 15s linear infinite;
}

@keyframes moveBackground {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50px, 50px);
  }
}

.auth-illustration-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.auth-icon {
  width: 100px;
  height: 100px;
  margin-bottom: 1.5rem;
  opacity: 0.9;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

.auth-illustration-content h2 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
}

.auth-illustration-content p {
  font-size: 1.1rem;
  margin: 0;
  opacity: 0.9;
}

/* Alerts */
.alert {
  padding: 1rem;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
  border-radius: 6px;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

.alert-danger {
  background: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

.alert-dismissible {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.alert-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: inherit;
  cursor: pointer;
  padding: 0;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.alert-close:hover {
  opacity: 1;
}

/* Text Utilities */
.text-danger {
  color: var(--auth-danger);
}

.text-muted {
  color: var(--auth-secondary);
}

/* Validation Styles */
.form-input.has-error {
  border-color: var(--auth-danger);
}

.input-error-message {
  color: var(--auth-danger);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  display: none;
}

.form-input.has-error + .input-error-message {
  display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
  .auth-wrapper {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .auth-content {
    padding: 2rem 1.5rem;
    min-height: auto;
  }

  .auth-illustration {
    display: none;
  }

  .auth-header h1 {
    font-size: 1.5rem;
  }

  .auth-form {
    gap: 1rem;
  }

  .auth-container {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .auth-wrapper {
    border-radius: 8px;
  }

  .auth-content {
    padding: 1.5rem 1rem;
  }

  .auth-header {
    margin-bottom: 1.5rem;
  }

  .auth-header h1 {
    font-size: 1.25rem;
  }

  .auth-header p {
    font-size: 0.9rem;
  }

  .form-input {
    font-size: 16px; /* Prevent zoom on iOS */
  }

  .btn {
    padding: 0.625rem 1rem;
    font-size: 0.95rem;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --auth-bg: #1a1a1a;
    --auth-text: #f0f0f0;
    --auth-border: #444;
    --auth-secondary: #aaa;
  }

  .auth-form .form-input {
    background: #2a2a2a;
    color: var(--auth-text);
  }

  .auth-form .form-input:focus {
    background: #333;
  }

  .auth-footer {
    border-top-color: var(--auth-border);
  }
}
