/*
 * ThinkForge Authentication Styles
 * Provides modern styling for the login/register modal created by public/js/lms-auth.js
 */

.thinkforge-login-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 10000;
}

.thinkforge-login-modal.is-visible {
  display: flex;
}

.thinkforge-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
}

.thinkforge-modal-content {
  position: relative;
  width: min(100%, 420px);
  background: #ffffff;
  border-radius: 1.25rem;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: lms-modal-fade-in 220ms ease-out;
}

.thinkforge-modal-header {
  padding: 1.75rem 2rem 1.25rem;
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.thinkforge-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.thinkforge-modal-header .modal-close {
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 150ms ease;
}

.thinkforge-modal-header .modal-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.thinkforge-modal-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.thinkforge-auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0 2rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  background: #f8fafc;
  margin-top: -1.25rem;
}

.thinkforge-auth-tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 180ms ease;
}

.thinkforge-auth-tab.active {
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.15);
}

.thinkforge-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.thinkforge-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.thinkforge-form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
}

.thinkforge-form-group input[type="text"],
.thinkforge-form-group input[type="email"],
.thinkforge-form-group input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-size: 0.95rem;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.thinkforge-form-group input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

.thinkforge-form-group .checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.thinkforge-form-group .checkbox-label input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #4f46e5;
}

.thinkforge-btn.thinkforge-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #ffffff;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
  box-shadow: 0 18px 35px -12px rgba(79, 70, 229, 0.45);
}

.thinkforge-btn.thinkforge-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 40px -15px rgba(67, 56, 202, 0.55);
}

.thinkforge-btn.thinkforge-btn-primary:disabled {
  background: linear-gradient(135deg, #a5b4fc, #818cf8);
  cursor: not-allowed;
  box-shadow: none;
}

.thinkforge-auth-notification {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.12);
  border-left: 4px solid #4f46e5;
  font-size: 0.95rem;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 10050;
}

.thinkforge-auth-notification.success {
  border-left-color: #16a34a;
}

.thinkforge-auth-notification.error {
  border-left-color: #dc2626;
}

@media (max-width: 640px) {
  .thinkforge-login-modal {
    padding: 1.5rem 1rem;
  }

  .thinkforge-modal-content {
    width: 100%;
  }

  .thinkforge-modal-body {
    padding: 1.5rem;
  }

  .thinkforge-auth-tabs {
    margin: -1rem 1.5rem 0;
  }
}

@keyframes lms-modal-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
