/* Authentication Pages - Modern Salesforce-Inspired Design */
/* Standardized with the main design system */

/* Import the main design system variables */
@import url('./modern-education.css');

/* ===== AUTH CONTAINER ===== */
.auth-container {
  position: relative;
  min-height: 100vh;
  background: var(--gradient-hero);
  overflow-x: hidden;
  font-family: var(--font-family-primary);
}

.auth-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.auth-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23032D60" fill-opacity="0.03"><circle cx="30" cy="30" r="1.5"/></g></svg>');
  opacity: 0.6;
}

.auth-content {
  position: relative;
  z-index: 1;
  padding: 2rem 0;
}

/* ===== AUTH CARD ===== */
.auth-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow-xl);
  position: relative;
  margin-bottom: 2rem;
  backdrop-filter: blur(20px);
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-subtle);
  border-radius: 16px;
  pointer-events: none;
  opacity: 0.5;
}

/* ===== AUTH HEADER ===== */
.auth-header {
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 1;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 2rem;
}

.logo-icon {
  background: var(--gradient-education);
  color: var(--white);
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: var(--shadow-education);
}

.logo-text {
  font-family: var(--font-family-display);
  font-size: 1.75rem;
  font-weight: var(--font-extrabold);
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.025em;
}

.auth-title {
  font-family: var(--font-family-display);
  font-size: 2rem;
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-align: center;
}

.auth-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  text-align: center;
  line-height: 1.5;
}

/* ===== AUTH FORM ===== */
.auth-form {
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  color: var(--text-primary);
  font-weight: var(--font-semibold);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  display: block;
}

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

.input-icon {
  position: absolute;
  left: 16px;
  z-index: 3;
  color: var(--text-tertiary);
  font-size: 16px;
  transition: color 0.3s ease;
}

.input-toggle {
  position: absolute;
  right: 16px;
  z-index: 3;
  color: var(--text-tertiary);
  font-size: 16px;
  cursor: pointer;
  transition: color 0.3s ease;
  padding: 4px;
}

.input-toggle:hover {
  color: var(--primary-education-light);
}

.auth-input {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px 48px;
  font-size: 15px;
  color: var(--text-primary);
  width: 100%;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-xs);
  font-family: var(--font-family-primary);
}

.auth-input::placeholder {
  color: var(--text-quaternary);
}

.auth-input:focus {
  outline: none;
  border-color: var(--primary-education-light);
  background: var(--white);
  box-shadow: var(--shadow-focus);
  transform: translateY(-1px);
}

.auth-input:focus + .input-icon,
.auth-input:focus ~ .input-icon {
  color: var(--primary-education-light);
}

/* Select dropdown */
select.auth-input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  appearance: none;
}

/* ===== FORM VALIDATION ===== */
.form-error {
  color: var(--error-education);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: block;
  font-weight: var(--font-medium);
}

.auth-validation-summary {
  background: var(--error-light);
  border: 1px solid rgba(194, 57, 52, 0.2);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  color: var(--error-education);
  font-size: 0.9rem;
  font-weight: var(--font-medium);
  display: none;
}

.auth-validation-summary:has(li),
.auth-validation-summary:has(ul) {
  display: block;
}

.auth-validation-summary ul {
  margin: 0;
  padding-left: 1.5rem;
}

/* ===== CUSTOM CHECKBOX ===== */
.form-check-custom {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.form-check-input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  background: var(--white);
  border: 2px solid var(--border-medium);
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

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

.form-check-input:checked::after {
  content: '\2713';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--white);
  font-size: 12px;
  font-weight: bold;
}

.form-check-input:focus {
  box-shadow: 0 0 0 2px rgba(4, 132, 75, 0.25);
}

.form-check-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  cursor: pointer;
  font-weight: var(--font-medium);
}

/* ===== BUTTONS ===== */
.btn-auth-primary {
  background: var(--gradient-education);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: var(--font-semibold);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  font-family: var(--font-family-primary);
  text-transform: none;
}

.btn-auth-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-education);
  color: var(--white);
  text-decoration: none;
  background: linear-gradient(135deg, #0070D2 0%, #032D60 100%);
}

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

.btn-auth-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ===== AUTH LINKS ===== */
.auth-links {
  text-align: center;
  margin-top: 1.5rem;
}

.auth-link {
  color: var(--primary-education-light);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: var(--font-semibold);
  transition: all 0.3s ease;
}

.auth-link:hover {
  color: var(--primary-education);
  text-decoration: underline;
}

/* ===== AUTH FOOTER ===== */
.auth-footer {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
  position: relative;
  z-index: 1;
}

.auth-footer-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

.auth-footer-link {
  color: var(--secondary-academic);
  text-decoration: none;
  font-weight: var(--font-semibold);
  transition: all 0.3s ease;
}

.auth-footer-link:hover {
  color: var(--secondary-academic-dark);
  text-decoration: underline;
}

/* ===== BACK TO HOME ===== */
.back-home {
  margin-top: 1.5rem;
}

.back-home-link {
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: var(--font-medium);
}

.back-home-link:hover {
  color: var(--primary-education-light);
  background: var(--bg-education-light);
  text-decoration: none;
  transform: translateY(-1px);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 767.98px) {
  .auth-card {
    padding: 2rem 1.5rem;
    margin: 1rem;
    border-radius: 12px;
  }
  
  .auth-title {
    font-size: 1.75rem;
  }
  
  .auth-input {
    padding: 14px 44px;
  }
  
  .logo-text {
    font-size: 1.5rem;
  }

  .auth-content {
    padding: 1rem 0;
  }
}

@media (max-width: 575.98px) {
  .auth-content {
    padding: 0.5rem 0;
  }
  
  .auth-card {
    margin: 0.5rem;
    padding: 1.5rem 1rem;
  }
  
  .auth-header {
    margin-bottom: 2rem;
  }
  
  .auth-logo {
    flex-direction: column;
    gap: 8px;
  }
  
  .logo-text {
    font-size: 1.25rem;
  }

  .auth-title {
    font-size: 1.5rem;
  }
}

/* ===== LOADING STATES ===== */
.btn-auth-primary.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-auth-primary.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 8px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== FOCUS IMPROVEMENTS ===== */
.auth-input:focus,
.form-check-input:focus,
.btn-auth-primary:focus {
  outline: none;
  box-shadow: var(--shadow-focus);
}

/* ===== ANIMATION IMPROVEMENTS ===== */
.auth-card {
  animation: fadeInUp 0.6s ease-out;
}

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

/* ===== SALESFORCE-INSPIRED ENHANCEMENTS ===== */
.auth-card {
  position: relative;
  overflow: hidden;
}

.auth-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 112, 210, 0.1), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Professional Form Focus States */
.input-group:focus-within .input-icon {
  color: var(--primary-education);
  transform: scale(1.1);
}

.form-group:hover .auth-input {
  border-color: var(--border-medium);
}

/* Success States */
.form-group.success .auth-input {
  border-color: var(--success-education);
  background-color: rgba(46, 132, 74, 0.02);
}

.form-group.success .input-icon {
  color: var(--success-education);
}

/* Error States */
.form-group.error .auth-input {
  border-color: var(--error-education);
  background-color: rgba(194, 57, 52, 0.02);
}

.form-group.error .input-icon {
  color: var(--error-education);
}

/* Modern Button Styles */
.btn-auth-primary {
  position: relative;
  overflow: hidden;
}

.btn-auth-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: left 0.6s;
}

.btn-auth-primary:hover::before {
  left: 100%;
}

/* Professional Typography */
.auth-title {
  background: linear-gradient(135deg, var(--primary-education) 0%, var(--primary-education-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Enhanced Visual Hierarchy */
.form-label {
  position: relative;
}

.form-label::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-education-light);
  transition: width 0.3s ease;
}

.form-group:focus-within .form-label::after {
  width: 100%;
}

/* Modern Card Shadow on Hover */
.auth-card:hover {
  box-shadow: var(--shadow-2xl);
  transform: translateY(-2px);
}

/* ===== WARNING & INFO STATES ===== */
.alert-warning {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  color: #856404;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.alert-info {
  background: rgba(0, 112, 210, 0.1);
  border: 1px solid rgba(0, 112, 210, 0.3);
  color: #0070D2;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.alert-success {
  background: rgba(46, 132, 74, 0.1);
  border: 1px solid rgba(46, 132, 74, 0.3);
  color: #2e844a;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

/* Warning Colors */
:root {
  --warning-education: #ffc107;
  --warning-education-light: #fff3cd;
  --warning-education-dark: #856404;
  --info-education: #0070D2;
  --info-education-light: #e3f2fd;
  --success-education: #2e844a;
  --success-education-light: #e8f5e8;
}