/**
 * Authentication Pages Styles
 */

:root {
  --auth-primary: #6366f1;
  --auth-primary-dark: #4f46e5;
  --auth-success: #10b981;
  --auth-error: #ef4444;
  --auth-warning: #f59e0b;
  --auth-light: #f3f4f6;
  --auth-border: #e5e7eb;
  --auth-text: #1f2937;
  --auth-text-light: #6b7280;
}

/* ============================================================
   AUTH MODAL STYLES
   ============================================================ */

/* Modal Overlay */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal.hidden {
  display: none;
}

.auth-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out;
}

/* Modal Content */
.auth-modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 450px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
  z-index: 1;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Modal Header */
.auth-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 30px 16px;
  border-bottom: 1px solid var(--auth-border);
}

.auth-modal-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--auth-text);
  margin: 0;
}

.auth-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--auth-text-light);
  transition: color 0.2s ease;
  border-radius: 6px;
}

.auth-modal-close:hover {
  color: var(--auth-text);
  background: var(--auth-light);
}

/* Modal Body */
.auth-modal-body {
  padding: 24px 30px 30px;
}

.auth-modal-subtitle {
  font-size: 14px;
  color: var(--auth-text-light);
  margin: 0 0 24px 0;
  text-align: center;
}

/* Modal Alerts */
.auth-alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  animation: slideDown 0.3s ease;
}

.auth-alert.hidden {
  display: none;
}

.auth-alert.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.auth-alert.alert-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Social Login Section */
.social-login-section {
  margin-bottom: 24px;
}

.social-login-title {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-text-light);
  margin: 0 0 12px 0;
}

.social-login-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.social-login-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  border: 1px solid var(--auth-border);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: var(--auth-text);
  transition: all 0.2s ease;
  min-height: 80px;
}

.social-login-btn:hover {
  background: var(--auth-light);
  border-color: var(--auth-primary);
  transform: translateY(-2px);
}

.social-login-btn svg {
  flex-shrink: 0;
}

/* Auth Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--auth-text-light);
  font-size: 12px;
}

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

/* Modal Links */
.auth-modal-links {
  text-align: center;
  margin: 15px 0;
}

.auth-modal-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--auth-border);
}

.auth-modal-footer p {
  font-size: 13px;
  color: var(--auth-text);
  margin: 0;
}

/* Field Errors */
.field-error {
  display: block;
  color: var(--auth-error);
  font-size: 12px;
  margin-top: 4px;
}

.field-error.hidden {
  display: none;
}

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

input.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Button Loading State */
.btn-spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-text.hidden,
.btn-spinner.hidden {
  display: none;
}

/* Password Toggle Button */
.btn-toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--auth-text-light);
  transition: color 0.2s ease;
}

.btn-toggle-password:hover {
  color: var(--auth-primary);
}

/* Success State (Forgot Password) */
.success-icon {
  text-align: center;
  margin-bottom: 16px;
}

/* Responsive Modal */
@media (max-width: 480px) {
  .auth-modal {
    padding: 10px;
  }

  .auth-modal-content {
    max-height: 95vh;
  }

  .auth-modal-header,
  .auth-modal-body {
    padding-left: 20px;
    padding-right: 20px;
  }

  .auth-modal-header h2 {
    font-size: 20px;
  }

  .social-login-buttons {
    gap: 8px;
  }

  .social-login-btn {
    min-height: 70px;
    font-size: 10px;
    padding: 8px 4px;
  }
}

/* ============================================================
   AUTH PAGE STYLES (Original)
   ============================================================ */

/* Auth Container */
.auth-container {
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F5F5F0;
  padding: 20px;
}

/* Auth Card */
.auth-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 450px;
  padding: 40px;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Auth Header */
.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

  .auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--auth-text);
    margin: 0 0 10px 0;
  }

  .auth-header .subtitle {
    font-size: 14px;
    color: var(--auth-text-light);
    margin: 0;
  }

/* Social Login Section */
.social-login {
  margin-bottom: 30px;
}

  .social-login h3 {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-text-light);
  }

/* Divider */
.divider,
.divider-text {
  text-align: center;
  margin: 20px 0;
  font-size: 12px;
  color: var(--auth-text-light);
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

  .divider-text::before {
    order: -1;
  }

  .divider-text::after {
    order: 1;
  }

  .divider span {
    background: white;
    padding: 0 10px;
    white-space: nowrap;
    order: 0;
  }

/* Social Buttons */
.social-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
  width: 100%;
}

.btn-social {
  padding: 10px 4px;
  border: 1px solid var(--auth-border);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 500;
  color: var(--auth-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.3s ease;
  min-height: 70px;
  word-break: break-word;
}

  .btn-social:hover {
    background: var(--auth-light);
    border-color: var(--auth-primary);
  }

  .btn-social.btn-google:hover {
    background: #f9f9f9;
  }

  .btn-social.btn-facebook:hover {
    background: #f0f8ff;
  }

  .btn-social.btn-twitter:hover {
    background: #f0f9ff;
  }

.social-icon {
  width: 28px;
  height: 28px;
  fill: currentColor;
  color: #1f2937;
}

/* Auth Form */
.auth-form {
  margin: 20px 0;
}

.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-text);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--auth-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s ease;
}

  .form-control:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  }

  .form-control::placeholder {
    color: #d1d5db;
  }

/* Password Input Group */
.password-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

  .password-input-group .form-control {
    padding-right: 45px;
  }

.btn-show-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--auth-text-light);
  transition: color 0.3s ease;
}

  .btn-show-password:hover {
    color: var(--auth-primary);
  }

.icon-eye {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Password Strength Indicator */
.password-strength {
  margin-top: 8px;
  display: none;
}

  .password-strength.show {
    display: block;
  }

.strength-bar {
  width: 0%;
  height: 4px;
  background: #dc3545;
  border-radius: 2px;
  margin-bottom: 4px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-text {
  font-size: 12px;
  color: var(--auth-text-light);
}

/* Password Requirements */
.password-requirements {
  margin-top: 12px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 6px;
  border: 1px solid var(--auth-border);
  display: none;
}

  .password-requirements.show {
    display: block;
  }

.req-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--auth-text);
  margin: 0 0 8px 0;
}

.password-requirements ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.password-requirements li {
  font-size: 12px;
  color: var(--auth-text-light);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

  .password-requirements li:last-child {
    margin-bottom: 0;
  }

.req-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--auth-border);
  border-radius: 3px;
  font-size: 11px;
  color: var(--auth-text-light);
  flex-shrink: 0;
}

  .req-check.met {
    background: var(--auth-success);
    color: white;
    border-color: var(--auth-success);
  }

/* Form Checkbox */
.form-check {
  margin: 20px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.form-check-input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
  border: 1px solid var(--auth-border);
  border-radius: 4px;
  transition: all 0.3s ease;
}

  .form-check-input:checked {
    background: var(--auth-primary);
    border-color: var(--auth-primary);
  }

.form-check-label {
  font-size: 13px;
  color: var(--auth-text);
  cursor: pointer;
  margin: 0;
}

  .form-check-label a {
    color: var(--auth-primary);
    text-decoration: none;
  }

    .form-check-label a:hover {
      text-decoration: underline;
    }

/* Primary Button */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-primary {
  background: var(--auth-primary);
  color: white;
}

  .btn-primary:hover {
    background: var(--auth-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
  }

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

  .btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
  }

.btn-block {
  width: 100%;
  margin-top: 10px;
}

/* Auth Links */
.auth-links {
  text-align: center;
  margin: 15px 0;
}

  .auth-links a,
  .link-primary {
    color: var(--auth-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
  }

    .auth-links a:hover,
    .link-primary:hover {
      text-decoration: underline;
    }

/* Auth Footer */
.auth-footer {
  text-align: center;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--auth-border);
}

  .auth-footer p {
    font-size: 13px;
    color: var(--auth-text);
    margin: 0;
  }

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

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

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert strong {
  font-weight: 600;
}

.alert-dismissible {
  position: relative;
  padding-right: 40px;
}

.btn-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: inherit;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

  .btn-close:hover {
    opacity: 0.7;
  }

/* Error Messages */
.text-danger {
  color: var(--auth-error);
  font-size: 12px;
  margin-top: 4px;
  display: block;
}

/* Responsive */
@media (max-width: 480px) {
  .auth-card {
    padding: 30px 20px;
  }

  .auth-header h1 {
    font-size: 24px;
  }

  .social-buttons {
    grid-template-columns: repeat(3, 1fr);
  }

  .btn-social {
    min-height: 70px;
    font-size: 10px;
    padding: 8px 4px;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .auth-container {
    background: #F5F5F0;
  }

  .auth-card {
    background: #1f2937;
    color: #f3f4f6;
  }

  .auth-header h1 {
    color: #f3f4f6;
  }

  .auth-header .subtitle {
    color: #9ca3af;
  }

  .form-control {
    background: #111827;
    border-color: #374151;
    color: #f3f4f6;
  }

    .form-control::placeholder {
      color: #6b7280;
    }

    .form-control:focus {
      border-color: var(--auth-primary);
      box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    }

  .btn-social {
    background: #111827;
    border-color: #374151;
    color: #f3f4f6;
  }

    .btn-social:hover {
      background: #1f2937;
      border-color: var(--auth-primary);
    }

    .btn-social .social-icon {
      color: #1f2937;
    }

  .divider-text {
    color: #6b7280;
  }

    .divider-text::before,
    .divider-text::after {
      background: #374151;
    }

    .divider-text span {
      background: #1f2937;
    }

  .password-requirements {
    background: #111827;
    border-color: #374151;
  }

  .req-title {
    color: #f3f4f6;
  }

  .password-requirements li {
    color: #9ca3af;
  }

  .form-check-label {
    color: #f3f4f6;
  }

  .auth-links,
  .auth-footer {
    border-color: #374151;
    color: #9ca3af;
  }
}
