/* Authentication Pages CSS */

/* Custom CSS Variables */
:root {
  --brand-accent: #2563eb;
  --brand-accent-strong: #1d4ed8;
  --brand-dark: #1e3a8a;
  --light-gray: #f4f7fb;
  --surface-soft: #f8fbff;
  --border-color: #dbe5f1;
  --text-primary: #0f172a;
  --text-muted: #64748b;
}

/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--light-gray);
  color: var(--text-primary);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.55) !important;
  outline-offset: 2px;
  box-shadow: none !important;
}

.btn {
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  min-height: 44px;
  padding: 0.7rem 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

/* Auth Container */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.25rem;
}

/* Left Side - Branding */
.auth-branding {
  display: none;
}

.auth-branding::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle,
      rgba(255, 255, 255, 0.1) 1px,
      transparent 1px);
  background-size: 50px 50px;
  animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(50px, 50px);
  }
}

.branding-content {
  position: relative;
  z-index: 2;
  color: white;
  max-width: 500px;
}

.logo-section {
  display: flex;
  align-items: center;
  animation: fadeInDown 0.8s ease-out;
}

.auth-logo {
  height: 60px;
  margin-right: 1rem;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.brand-name {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
}

.welcome-text {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  animation: fadeInUp 0.8s ease-out;
}

.welcome-subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.feature-list {
  animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.feature-item {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.feature-item:hover {
  transform: translateX(10px);
}

.feature-item i {
  font-size: 1.5rem;
  margin-right: 1rem;
  color: #3b82f6;
}

/* Right Side - Form Section */
.auth-form-section {
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background-color: transparent;
}

.auth-form-container {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

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

.form-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 0.5rem;
}

.form-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(37, 99, 235, 0.14);
  color: var(--brand-accent-strong);
  border: 1px solid rgba(37, 99, 235, 0.42);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-logo {
  height: 52px;
  margin-right: 0;
  filter: none;
  animation: none;
}

/* Form Styles */
.auth-form {
  margin-top: 2rem;
}

.form-label {
  font-weight: 600;
  color: var(--brand-dark);
  margin-bottom: 0.5rem;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 15px;
  z-index: 10;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.input-icon-right {
  position: absolute;
  right: 15px;
  z-index: 10;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  transition: color 0.3s ease;
}

.input-icon-right:hover {
  color: var(--brand-accent);
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.form-control {
  padding: 0.75rem 1rem 0.75rem 3rem;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control.with-toggle {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #6c757d;
  z-index: 12;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: var(--brand-accent);
}

.password-strength {
  margin-top: 0.7rem;
}

.password-strength-track {
  width: 100%;
  height: 7px;
  background: #e9ecef;
  border-radius: 999px;
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 0.25s ease;
}

.password-rules {
  list-style: none;
  padding-left: 0;
  margin: 0.6rem 0 0;
}

.password-rules li {
  font-size: 0.83rem;
  margin-bottom: 0.2rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.password-rules li.rule-valid {
  color: #198754;
}

.auth-helper {
  background: var(--surface-soft);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  font-size: 0.88rem;
  color: #5a6470;
}

.attempt-hint {
  display: none;
  margin-top: 0.7rem;
  font-size: 0.86rem;
  color: #1d4ed8;
}

.attempt-hint.show {
  display: block;
}

.form-control:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

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

.form-check-label {
  color: #6c757d;
  cursor: pointer;
}

.forgot-password {
  color: var(--brand-accent);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.forgot-password:hover {
  color: var(--brand-accent-strong);
  text-decoration: underline;
}

/* Submit Button */
.btn-auth {
  background: linear-gradient(135deg, var(--brand-accent) 0%, var(--brand-accent-strong) 100%);
  color: white;
  border: none;
  min-height: 46px;
  padding: 0.72rem 1.2rem;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-auth:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  background: linear-gradient(135deg, var(--brand-accent-strong) 0%, var(--brand-accent) 100%);
}

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

#forgotPasswordForm .form-group {
  margin-bottom: 1.4rem;
}

#forgotPasswordForm #resetBtn {
  margin-top: 0.6rem;
  min-height: 48px;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* Divider */
.divider {
  text-align: center;
  margin: 2rem 0;
  position: relative;
}

.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background-color: var(--border-color);
}

.divider span {
  background-color: white;
  padding: 0 1rem;
  color: var(--text-muted);
  font-weight: 600;
  position: relative;
  z-index: 1;
}

/* Social Login Buttons */
.social-login {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-social {
  min-height: 44px;
  padding: 0.68rem 1.1rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  border: 2px solid var(--border-color);
  background-color: white;
  color: var(--brand-dark);
}

.btn-social:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-google:hover {
  background-color: var(--surface-soft);
  border-color: var(--brand-accent);
  color: var(--brand-dark);
}

.btn-facebook:hover {
  background-color: var(--surface-soft);
  border-color: var(--brand-accent);
  color: var(--brand-dark);
}

/* Sign Up/Sign In Link */
.signup-text {
  color: var(--text-muted);
  margin-bottom: 0;
}

.signup-link {
  color: var(--brand-accent);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.signup-link:hover {
  color: var(--brand-accent-strong);
  text-decoration: underline;
}

.terms-link {
  color: var(--brand-accent);
  text-decoration: none;
  font-weight: 600;
}

.terms-link:hover {
  text-decoration: underline;
}

/* Back to Home Link */
.back-home {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
}

.back-home:hover {
  color: var(--brand-accent);
}

/* Password Strength Indicator */
.form-text {
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Responsive Design */
@media (max-width: 992px) {
  .auth-container {
    padding: 1rem;
  }
}

@media (max-width: 576px) {
  .form-title {
    font-size: 1.5rem;
  }

  .auth-form-container {
    padding: 1.25rem;
  }

  .form-control {
    padding: 0.625rem 1rem 0.625rem 2.5rem;
  }

  .input-icon {
    left: 10px;
    font-size: 1rem;
  }

  .btn-auth {
    min-height: 46px;
    padding: 0.66rem 1.05rem;
    font-size: 1rem;
  }

  .btn-social {
    min-height: 42px;
    padding: 0.62rem 0.95rem;
    font-size: 0.9rem;
  }
}

/* Loading Animation */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--brand-accent);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

/* Hover Effects */
.form-control:hover {
  border-color: #b9c9dd;
}

.form-check-input:hover {
  cursor: pointer;
  border-color: var(--brand-accent);
}

/* Focus States */
.btn-auth:focus,
.btn-social:focus,
.form-control:focus {
  outline: none;
}

/* Smooth Transitions */
* {
  transition:
    color 0.3s ease,
    background-color 0.3s ease,
    border-color 0.3s ease;
}