/**
 * Auth pages - Premium School ERP style
 * Bootstrap 5 + custom overrides
 */
:root {
  --auth-brand-gradient: linear-gradient(135deg, #1e3a5f 0%, #2d1b4e 50%, #1a1f3a 100%);
  --auth-card-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  --auth-input-focus-glow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  --auth-error-bg: rgba(220, 38, 38, 0.08);
  --auth-success-bg: rgba(16, 185, 129, 0.08);
}

body.auth-page-body {
  font-family: 'Poppins', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Split layout */
.auth-split-row {
  min-height: 100vh;
}

.auth-brand-panel {
  background: var(--auth-brand-gradient);
  padding: 3rem 2.5rem;
  position: relative;
  overflow: hidden;
}

.auth-brand-panel::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.auth-brand-panel .auth-brand-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.auth-brand-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-brand-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.auth-brand-subtitle {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.auth-brand-desc {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
  max-width: 280px;
}

.auth-brand-icon {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2rem 0;
}

.auth-brand-icon svg {
  width: 64px;
  height: 64px;
  color: rgba(255, 255, 255, 0.9);
}

.auth-brand-footer {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: auto;
  padding-top: 2rem;
}

/* Right side - form area */
.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #f8fafc;
}

.auth-form-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--auth-card-shadow);
  padding: 2.5rem;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.profile-form-card {
  max-width: 720px;
}

.auth-btn-secondary {
  width: 100%;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9375rem;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  color: #475569;
  transition: background 0.2s, border-color 0.2s;
}

.auth-btn-secondary:hover {
  background: #cbd5e1;
  border-color: #94a3b8;
  color: #334155;
}

.auth-form-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.35rem;
}

.auth-form-subtitle {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 1.75rem;
}

/* Form controls */
.auth-input-group {
  position: relative;
}

.auth-input-group .form-control {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 0.75rem 1rem 0.75rem 3rem;
  font-size: 0.9375rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input-group .form-control:focus {
  border-color: #6366f1;
  box-shadow: var(--auth-input-focus-glow);
  outline: 0;
}

.auth-input-group .input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 2;
}

.auth-input-group .password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #94a3b8;
  padding: 0.25rem;
  cursor: pointer;
  z-index: 2;
}

.auth-input-group .password-toggle:hover {
  color: #64748b;
}

/* Checkbox */
.auth-checkbox-wrap .form-check-input {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  cursor: pointer;
}

.auth-checkbox-wrap .form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.auth-checkbox-wrap .form-check-input:checked {
  background-color: #6366f1;
  border-color: #6366f1;
}

.auth-checkbox-wrap .form-check-label {
  font-size: 0.875rem;
  color: #475569;
  cursor: pointer;
  margin-left: 0.5rem;
}

/* Primary button */
.auth-btn-primary {
  width: 100%;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9375rem;
  background: #6366f1;
  border: none;
  color: #fff;
  transition: background 0.2s, transform 0.15s;
}

.auth-btn-primary:hover:not(:disabled) {
  background: #4f46e5;
  color: #fff;
  transform: translateY(-1px);
}

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

.auth-btn-primary:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

.auth-btn-primary .spinner-border {
  width: 1.1rem;
  height: 1.1rem;
  border-width: 2px;
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* Alerts */
.auth-alert {
  border-radius: 12px;
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  border: none;
  animation: authAlertIn 0.3s ease;
}

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

.auth-alert-danger {
  background: var(--auth-error-bg);
  color: #b91c1c;
}

.auth-alert-success {
  background: var(--auth-success-bg);
  color: #047857;
}

/* Forgot password link */
.auth-forgot-link {
  font-size: 0.875rem;
  color: #6366f1;
  text-decoration: none;
  font-weight: 500;
}

.auth-forgot-link:hover {
  color: #4f46e5;
  text-decoration: underline;
}

.auth-forgot-link.btn-link-style {
  cursor: pointer;
}

/* Modal */
.auth-modal .modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
}

.auth-modal .modal-header {
  border-bottom: 1px solid #e2e8f0;
  padding: 1.25rem 1.5rem;
}

.auth-modal .modal-title {
  font-weight: 700;
  color: #1e293b;
}

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

.auth-modal .btn-close {
  padding: 0.5rem;
}

/* Password strength */
.password-strength {
  height: 4px;
  border-radius: 2px;
  background: #e2e8f0;
  margin-top: 0.5rem;
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
}

.password-strength-bar.weak { width: 33%; background: #ef4444; }
.password-strength-bar.fair { width: 66%; background: #f59e0b; }
.password-strength-bar.strong { width: 100%; background: #22c55e; }

/* Mobile */
@media (max-width: 991.98px) {
  .auth-brand-panel {
    display: none !important;
  }

  .auth-form-panel {
    padding: 1.5rem;
    min-height: 100vh;
  }

  .auth-form-card {
    padding: 1.75rem;
  }
}
