/* Central University — Staff Auth (split-screen) */

:root {
  --cu-maroon: #992621;
  --cu-maroon-mid: #992621;
  --cu-maroon-deep: #992621;
  --cu-gold: #c9a24a;
  --cu-gold-soft: #d4b56a;
  --cu-ink: #1f2937;
  --cu-muted: #6b7280;
  --cu-border: #e5e7eb;
  --cu-border-focus: #992621;
  --cu-surface: #ffffff;
  --cu-radius: 10px;
  --cu-font-display: "Nunito", "Open Sans", system-ui, sans-serif;
  --cu-font-ui: "Open Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.auth-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--cu-font-ui);
  color: var(--cu-ink);
  background: var(--cu-surface);
  -webkit-font-smoothing: antialiased;
}

/* Centered card over campus background image */
.auth-center {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background-color: #3a1518;
  background-image: var(--auth-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.auth-center::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(20, 8, 10, 0.45);
  pointer-events: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 14px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  animation: authFadeUp 0.65s ease both;
}

.auth-card-brand {
  text-align: center;
  margin-bottom: 1.35rem;
}

.auth-card-brand img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 0.85rem;
}

.auth-card-brand h1 {
  font-family: var(--cu-font-display);
  font-size: 1.85rem;
  font-weight: 600;
  color: var(--cu-maroon);
  margin: 0 0 0.25rem;
  line-height: 1.2;
}

.auth-card-brand p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--cu-muted);
}

.auth-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  width: 100%;
}

/* —— Left brand panel —— */
.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  color: #fff;
  background:
    radial-gradient(ellipse 80% 60% at 70% 40%, rgba(107, 30, 38, 0.35) 0%, transparent 60%),
    linear-gradient(165deg, var(--cu-maroon) 0%, var(--cu-maroon-mid) 45%, var(--cu-maroon-deep) 100%);
  overflow: hidden;
  text-align: center;
}

.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      -18deg,
      transparent,
      transparent 14px,
      rgba(255, 255, 255, 0.015) 14px,
      rgba(255, 255, 255, 0.015) 15px
    );
  pointer-events: none;
}

.auth-brand::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1px solid rgba(201, 162, 74, 0.12);
  top: -80px;
  right: -120px;
  pointer-events: none;
}

.auth-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 380px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: authFadeUp 0.7s ease both;
}

.auth-brand-logo {
  width: 112px;
  height: 112px;
  object-fit: contain;
  margin-bottom: 1.75rem;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
  animation: authLogoIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-brand-title {
  font-family: var(--cu-font-display);
  font-size: clamp(2.1rem, 3.2vw, 2.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.01em;
  margin: 0 0 0.65rem;
  color: #fff;
}

.auth-brand-subtitle {
  font-family: var(--cu-font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cu-gold);
  margin: 0 0 1.35rem;
}

.auth-brand-desc {
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 1.1rem;
  max-width: 320px;
}

.auth-brand-locations {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
  margin: 0 0 2rem;
}

.auth-brand-footer {
  width: 100%;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-brand-motto {
  font-family: var(--cu-font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--cu-gold-soft);
  margin: 0;
  letter-spacing: 0.02em;
}

/* —— Right form panel —— */
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: var(--cu-surface);
  position: relative;
}

.auth-panel-inner {
  width: 100%;
  max-width: 420px;
  animation: authFadeUp 0.65s 0.1s ease both;
}

.auth-card .auth-form-title {
  text-align: center;
  font-size: 1.55rem;
}

.auth-card .auth-form-lead {
  text-align: center;
}

.auth-card .auth-step {
  display: block;
  text-align: center;
}

.auth-form-title {
  font-family: var(--cu-font-display);
  font-size: clamp(1.85rem, 2.8vw, 2.35rem);
  font-weight: 600;
  color: var(--cu-maroon);
  margin: 0 0 0.4rem;
  line-height: 1.2;
}

.auth-form-lead {
  font-size: 0.95rem;
  color: var(--cu-muted);
  margin: 0 0 1.85rem;
  line-height: 1.5;
}

.auth-form-lead strong {
  color: var(--cu-ink);
  font-weight: 600;
}

.auth-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cu-ink);
  margin-bottom: 0.45rem;
}

.auth-field {
  margin-bottom: 1.15rem;
}

.auth-input,
.auth-input.form-control,
.auth-select {
  width: 100%;
  height: 48px;
  padding: 0.7rem 0.95rem;
  font-family: var(--cu-font-ui);
  font-size: 0.95rem;
  color: var(--cu-ink);
  background: #fff;
  border: 1.5px solid var(--cu-border);
  border-radius: var(--cu-radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.auth-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.2rem;
}

.auth-dob-row {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 0.55rem;
}

.auth-step {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--cu-maroon);
  margin-bottom: 0.5rem;
}

.auth-input::placeholder {
  color: #9ca3af;
}

.auth-input:hover {
  border-color: #c4c9d1;
}

.auth-input:focus,
.auth-input.form-control:focus,
.auth-select:focus {
  border-color: var(--cu-border-focus);
  box-shadow: 0 0 0 3px rgba(107, 30, 38, 0.12);
}

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

.auth-input-wrap .auth-input {
  padding-right: 2.75rem;
}

.auth-toggle-pw {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--cu-muted);
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.auth-toggle-pw:hover {
  color: var(--cu-maroon);
  background: rgba(107, 30, 38, 0.06);
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 48px;
  margin-top: 0.35rem;
  padding: 0 1.25rem;
  font-family: var(--cu-font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  text-decoration: none;
  color: #fff;
  background: var(--cu-maroon);
  border: none;
  border-radius: var(--cu-radius);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(153, 38, 33, 0.22);
}

a.auth-btn:hover {
  color: #fff;
}

.auth-btn:hover:not(:disabled) {
  background: #5a1820;
  box-shadow: 0 6px 18px rgba(107, 30, 38, 0.3);
}

.auth-btn:active:not(:disabled) {
  transform: translateY(1px);
}

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

.auth-btn-secondary {
  background: transparent;
  color: var(--cu-maroon);
  border: 1.5px solid rgba(107, 30, 38, 0.25);
  box-shadow: none;
  margin-top: 0.75rem;
}

.auth-btn-secondary:hover:not(:disabled) {
  background: rgba(107, 30, 38, 0.05);
  box-shadow: none;
}

.auth-footer {
  margin-top: 1.35rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--cu-muted);
  line-height: 1.6;
}

.auth-footer a {
  color: var(--cu-maroon);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-footer a:hover {
  color: var(--cu-maroon-deep);
  text-decoration: underline;
}

.auth-sep {
  margin: 0 0.4rem;
  color: #c4c9d1;
}

.auth-error {
  font-size: 0.82rem;
  color: #b42318;
  margin-top: 0.35rem;
}

.auth-alert {
  border-radius: var(--cu-radius);
  padding: 0.75rem 0.95rem;
  font-size: 0.875rem;
  margin-bottom: 1.15rem;
  border: 1px solid transparent;
}

.auth-alert-danger {
  background: #fef3f2;
  border-color: #fecdca;
  color: #b42318;
}

.auth-alert-success {
  background: #ecfdf3;
  border-color: #abefc6;
  color: #067647;
}

.auth-alert-info,
.auth-alert-warning {
  background: #fffaeb;
  border-color: #fedf89;
  color: #93370d;
}

.auth-hint {
  font-size: 0.8rem;
  color: var(--cu-muted);
  margin-top: 0.4rem;
}

/* OTP digit boxes */
.auth-otp {
  display: flex;
  gap: 0.55rem;
  justify-content: space-between;
  margin: 0.25rem 0 0.5rem;
}

.auth-otp-digit {
  flex: 1;
  max-width: 56px;
  height: 58px;
  text-align: center;
  font-family: var(--cu-font-ui);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--cu-ink);
  border: 1.5px solid var(--cu-border);
  border-radius: var(--cu-radius);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  caret-color: var(--cu-maroon);
}

.auth-otp-digit:focus {
  border-color: var(--cu-maroon);
  box-shadow: 0 0 0 3px rgba(107, 30, 38, 0.12);
}

.auth-otp-digit.is-filled {
  border-color: var(--cu-gold);
  background: #fffdf7;
}

.auth-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--cu-maroon);
  cursor: pointer;
}

.auth-link-btn:hover {
  text-decoration: underline;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--cu-muted);
  text-decoration: none;
}

.auth-back:hover {
  color: var(--cu-maroon);
}

/* Compact brand strip for very small screens is handled via media */
@keyframes authFadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes authLogoIn {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Toast tweaks on auth pages */
.auth-body .toast-container {
  z-index: 1080;
}

.auth-body .toast {
  border-radius: 10px;
  overflow: hidden;
}

/* —— Responsive —— */
@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .auth-brand {
    min-height: auto;
    padding: 2rem 1.5rem 1.75rem;
  }

  .auth-brand-logo {
    width: 72px;
    height: 72px;
    margin-bottom: 1rem;
  }

  .auth-brand-title {
    font-size: 1.75rem;
  }

  .auth-brand-desc,
  .auth-brand-locations {
    display: none;
  }

  .auth-brand-footer {
    border-top: 0;
    padding-top: 0.65rem;
  }

  .auth-brand-motto {
    font-size: 1rem;
  }

  .auth-panel {
    padding: 1.75rem 1.25rem 2.5rem;
    align-items: flex-start;
  }

  .auth-panel-inner {
    max-width: 440px;
  }
}

@media (max-width: 420px) {
  .auth-otp {
    gap: 0.35rem;
  }

  .auth-otp-digit {
    height: 50px;
    font-size: 1.25rem;
    max-width: none;
  }
}
