/**
 * Auth pages (login, register) – split-panel layout, Course Designer branding.
 * (c) 2025 Mario Santos, msdevweb@gmail.com
 */

:root {
  /* Match main app mauve/purple palette (theme.css) */
  --auth-bg: linear-gradient(135deg, #faf9fc 0%, #f5f3f8 50%, #eeeaf5 100%);
  --auth-card-bg: #ffffff;
  --auth-panel-gradient: linear-gradient(165deg, #5c4d7a 0%, #7c6b9e 40%, #a89bc4 100%);
  --auth-primary: #7c6b9e;
  --auth-primary-hover: #6a5a8a;
  --auth-text: #2d2a35;
  --auth-text-muted: #6b6578;
  --auth-border: #e8e4ef;
  --auth-radius: 1.25rem;
  --auth-radius-sm: 0.75rem;
  --auth-radius-pill: 9999px;
  --auth-shadow: 0 25px 50px -12px rgba(124, 107, 158, 0.2);
  --auth-font: "Fira Sans", "Segoe UI", system-ui, sans-serif;
}

.auth-page {
  min-height: 100vh;
  background: var(--auth-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  font-family: var(--auth-font);
}

.auth-card {
  width: 100%;
  max-width: 920px;
  background: var(--auth-card-bg);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: row;
  min-height: 520px;
}

@media (max-width: 767px) {
  .auth-card {
    flex-direction: column;
    min-height: auto;
  }
}

.auth-form-col {
  flex: 1;
  padding: 2.5rem 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.auth-brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.auth-brand-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--auth-text);
}

.auth-form-col h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--auth-text);
  margin-bottom: 0.25rem;
}

.auth-form-col .auth-subtitle {
  font-size: 0.9375rem;
  color: var(--auth-text-muted);
  margin-bottom: 1.75rem;
}

.auth-input-wrap {
  position: relative;
  margin-bottom: 1.25rem;
}

.auth-input-wrap .form-control {
  padding-left: 2.75rem;
  padding-right: 2.75rem;
  height: 3rem;
  border-radius: var(--auth-radius-sm);
  border: 1px solid var(--auth-border);
  font-size: 0.9375rem;
}

.auth-input-wrap .form-control:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(124, 107, 158, 0.2);
}

.auth-input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--auth-text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

.auth-input-wrap.password-wrap .auth-toggle-pw {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--auth-text-muted);
  padding: 0.25rem;
  cursor: pointer;
}

.auth-input-wrap.password-wrap .auth-toggle-pw:hover {
  color: var(--auth-primary);
}

.auth-btn-primary {
  width: 100%;
  height: 3rem;
  border-radius: var(--auth-radius-sm);
  background: var(--auth-primary);
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  transition: background 0.2s ease;
}

.auth-btn-primary:hover {
  background: var(--auth-primary-hover);
  color: #fff;
}

.auth-btn-primary .bi {
  font-size: 1.25rem;
}

.auth-divider {
  text-align: center;
  margin: 1.5rem 0;
  color: var(--auth-text-muted);
  font-size: 0.875rem;
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  color: var(--auth-text-muted);
}

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

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

.auth-panel {
  width: 42%;
  min-width: 280px;
  background: var(--auth-panel-gradient);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

@media (max-width: 767px) {
  .auth-panel {
    width: 100%;
    min-height: 220px;
    padding: 2rem;
  }
}

.auth-panel::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 150%;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.auth-panel-headline {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.auth-panel-tagline {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
}

.auth-panel-tagline span {
  color: #e8e2f0;
}

.auth-panel-quote {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.auth-panel-quote-text,
.auth-panel-quote-author {
  transition: opacity 0.35s ease;
}

.auth-panel-quote.fade-out .auth-panel-quote-text,
.auth-panel-quote.fade-out .auth-panel-quote-author {
  opacity: 0;
}

.auth-panel-quote-text {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.95);
  font-style: italic;
  margin-bottom: 0.35rem;
}

.auth-panel-quote-author {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.75);
}

.auth-alert {
  border-radius: var(--auth-radius-sm);
  margin-bottom: 1.25rem;
}

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

.auth-form-col .form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--auth-text);
  margin-bottom: 0.35rem;
}

.auth-form-col .invalid-feedback {
  font-size: 0.8125rem;
}
