/* =========================================
   TNHS-SHS LMS | AUTHENTICATION STYLES
   File: assets/css/auth.css
   ========================================= */

/* 1. FONTS & VARIABLES */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap");

:root {
  --school-maroon: #8a1c1c;
  --school-crimson: #c41e3a;
  --school-gold: #f3c64d;
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --bg-light: #f4f6f9;
}

/* Global motion policy: no animations, only smooth transitions */
*,
*::before,
*::after {
  animation: none !important;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

/* 2. GLOBAL RESET */
html,
body {
  min-height: 100dvh;
  height: 100%;
}

body {
  font-family: "Plus Jakarta Sans", sans-serif;
  background-color: var(--bg-light);
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

/* 3. SPLIT LAYOUT CONTAINER */
.auth-container {
  display: flex;
  min-height: 100dvh;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(138, 28, 28, 0.08), transparent 32%),
    linear-gradient(180deg, #f7f8fb 0%, #eef2f7 100%);
}

/* 4. LEFT SIDE (BRANDING) */
.auth-left {
  background: linear-gradient(165deg, #7a1717 0%, #631212 100%);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(1.15rem, 3.2vh, 3rem) clamp(1.15rem, 2.8vw, 3.25rem);
  position: relative;
  overflow: hidden;
  width: 48%;
  min-height: 0;
  height: 100%;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
}

/* Decorative Background Elements */
.auth-left::before {
  content: "";
  position: absolute;
  width: clamp(220px, 32vw, 500px);
  height: clamp(220px, 32vw, 500px);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  top: -100px;
  left: -100px;
  z-index: 1;
}

.auth-left::after {
  content: "";
  position: absolute;
  width: clamp(160px, 18vw, 300px);
  height: clamp(160px, 18vw, 300px);
  background: rgba(251, 192, 45, 0.1);
  border-radius: 8px;
  bottom: -50px;
  right: -50px;
  z-index: 1;
}

.auth-content-wrapper {
  position: relative;
  z-index: 2;
  text-align: center;
  width: min(100%, clamp(240px, 34vw, 560px));
  margin: 0 auto;
}

.auth-brand-title {
  font-size: clamp(2rem, 4vw, 3.75rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0 0 0.5rem 0;
  text-wrap: balance;
}

.auth-brand-subtitle {
  margin: 0 0 0.9rem 0;
  font-size: clamp(1.1rem, 1.6vw, 1.55rem);
  line-height: 1.15;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}

.school-logo {
  width: clamp(150px, 19vh, 220px);
  height: clamp(150px, 19vh, 220px);
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  margin-bottom: clamp(0.9rem, 2vh, 1.6rem);
  border: none;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.2));
}

.school-logo-lg {
  width: clamp(260px, 40vh, 420px);
  height: clamp(260px, 40vh, 420px);
}

/* 5. RIGHT SIDE (FORM) */
.auth-right {
  background:
    radial-gradient(circle at top right, rgba(138, 28, 28, 0.05), transparent 30%),
    rgba(255, 255, 255, 0.92);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(0.85rem, 2.2vh, 2.25rem) clamp(0.85rem, 2vw, 2rem);
  width: 52%;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.auth-form-container {
  width: min(100%, clamp(280px, 36vw, 540px));
  box-sizing: border-box;
  padding: clamp(1.1rem, 1.8vw, 2.2rem);
  margin: auto 0;
  border: 1px solid rgba(138, 28, 28, 0.08);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 251, 252, 0.96) 100%);
  box-shadow:
    0 18px 45px rgba(16, 24, 40, 0.12),
    0 2px 10px rgba(16, 24, 40, 0.04);
}

.auth-form-container h4 {
  font-size: clamp(1.15rem, 1.5vw, 1.7rem);
  color: var(--text-dark);
  letter-spacing: -0.03em;
}

.auth-form-container .text-muted.small,
.auth-form-container .small,
.auth-form-container .form-text {
  font-size: clamp(0.74rem, 0.84vw, 0.88rem);
}

.auth-form-container .alert {
  padding: clamp(0.6rem, 0.85vw, 0.85rem) clamp(0.7rem, 1vw, 1rem);
  margin-bottom: clamp(0.85rem, 1.2vw, 1.5rem) !important;
  border-radius: 14px;
  border-width: 1px;
}

.auth-form-container .mb-4 {
  margin-bottom: clamp(0.8rem, 1.1vw, 1.35rem) !important;
}

.auth-form-container .mb-3 {
  margin-bottom: clamp(0.7rem, 0.95vw, 1rem) !important;
}

.auth-form-container .mt-4 {
  margin-top: clamp(0.8rem, 1.1vw, 1.25rem) !important;
}

/* Form Controls */
.form-label {
  font-size: clamp(0.72rem, 0.78vw, 0.85rem);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.45rem;
}

.form-control {
  padding: clamp(0.62rem, 0.72vw, 0.82rem) clamp(0.82rem, 0.95vw, 1rem);
  border-radius: 12px;
  border: 1.5px solid #d7dde5;
  font-size: clamp(0.84rem, 0.88vw, 0.92rem);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  background-color: #fff;
  min-height: 3rem;
}

.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 2.75rem;
}

/* Hide browser's native password reveal button */
.password-field .form-control::-ms-reveal,
.password-field .form-control::-ms-clear {
  display: none;
}

.password-field .form-control::-webkit-credentials-auto-fill-button,
.password-field .form-control::-webkit-contacts-auto-fill-button {
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  right: 0;
}

.password-toggle {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.25rem;
  line-height: 1;
  cursor: pointer;
}

.password-toggle:hover {
  color: #5f1111;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--school-maroon);
  box-shadow: 0 0 0 3px rgba(138, 28, 28, 0.18);
  background-color: white;
  outline: none;
}

/* Custom Primary Button */
.btn-primary-custom {
  background-color: var(--school-maroon);
  color: white;
  border: none;
  padding: clamp(0.78rem, 0.95vw, 0.9rem);
  border-radius: 12px;
  font-weight: 600;
  font-size: clamp(0.86rem, 0.9vw, 0.92rem);
  width: 100%;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 10px 20px rgba(138, 28, 28, 0.2);
}

.btn-primary-custom:hover {
  background-color: #6d1414;
  box-shadow: 0 14px 24px rgba(138, 28, 28, 0.28);
}

.badge.bg-warning.text-dark,
.badge.bg-light.text-dark {
  border-radius: 999px;
}

/* 6. UTILITIES & LINKS */
.text-link {
  color: var(--school-maroon);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.text-link:hover {
  color: #5f1111;
  text-decoration: underline;
}

.otp-input {
  letter-spacing: clamp(4px, 0.65vw, 8px);
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  text-align: center;
  font-weight: 700;
  color: var(--school-maroon);
}

.auth-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.2rem, 0.45vw, 0.5rem);
  flex-wrap: wrap;
}

.auth-stepper-center {
  justify-content: center;
}

.auth-step {
  display: inline-flex;
  align-items: center;
  padding: clamp(0.2rem, 0.4vw, 0.35rem) clamp(0.42rem, 0.78vw, 0.7rem);
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: clamp(0.64rem, 0.72vw, 0.78rem);
  font-weight: 700;
}

.auth-step-active {
  background: rgba(138, 28, 28, 0.1);
  color: var(--school-maroon);
}

.auth-step-divider {
  width: clamp(10px, 1.25vw, 16px);
  height: 2px;
  border-radius: 999px;
  background: #d1d5db;
}

.auth-password-checklist {
  display: grid;
  gap: 0.35rem;
}

.auth-check-item {
  display: flex;
  align-items: center;
  color: #6b7280;
  font-size: clamp(0.74rem, 0.8vw, 0.85rem);
}

.auth-check-item i {
  color: #94a3b8;
}

.auth-check-item-passed {
  color: #166534;
  font-weight: 600;
}

.auth-check-item-passed i {
  color: #16a34a;
}

.auth-inline-note {
  display: flex;
  align-items: flex-start;
  border-radius: 14px;
  padding: clamp(0.72rem, 0.95vw, 0.92rem) clamp(0.78rem, 1.1vw, 1rem);
  background: linear-gradient(180deg, #fbfcfe 0%, #f6f8fb 100%);
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: clamp(0.76rem, 0.82vw, 0.88rem);
}

/* 7. MOBILE RESPONSIVENESS */
@media (max-width: 991.98px) {
  .auth-container {
    display: grid;
    grid-template-rows: minmax(215px, auto) minmax(0, 1fr);
    min-height: 100dvh;
    height: auto;
  }

  .auth-left {
    width: 100%;
    min-height: 0;
    height: 100%;
    padding: clamp(0.85rem, 2.2vh, 1.6rem) 1rem;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .auth-left::before,
  .auth-left::after {
    opacity: 0.4;
  }

  .school-logo {
    width: clamp(120px, 14vh, 156px);
    height: clamp(120px, 14vh, 156px);
    margin-bottom: 0.7rem;
  }

  .school-logo-lg {
    width: clamp(180px, 24vh, 240px);
    height: clamp(180px, 24vh, 240px);
  }

  .auth-brand-title {
    font-size: clamp(1.55rem, 4.6vw, 2.3rem);
    margin-bottom: 0.35rem;
  }

  .auth-brand-subtitle {
    font-size: clamp(0.98rem, 3vw, 1.28rem);
    margin-bottom: 0;
  }

  .auth-right {
    width: 100%;
    min-height: 0;
    height: auto;
    padding: clamp(0.7rem, 1.8vh, 1.2rem) 0.8rem 0.8rem;
    margin-top: 0;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .auth-form-container {
    background: white;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(16, 24, 40, 0.08);
    padding: clamp(1rem, 2vh, 1.35rem) clamp(0.92rem, 2.4vw, 1.12rem);
    max-width: 100%;
    width: min(100%, 540px);
  }

  .form-control,
  .form-select {
    font-size: 16px;
  }

  .btn-primary-custom {
    padding: 0.78rem;
    font-size: 0.92rem;
  }
}

/* Extra Small Devices */
@media (max-width: 575.98px) {
  .auth-container {
    grid-template-rows: minmax(188px, auto) minmax(0, 1fr);
    min-height: 100dvh;
    height: auto;
  }

  .auth-left {
    padding: 0.75rem 0.8rem;
  }

  .school-logo {
    width: clamp(104px, 11.5vh, 124px);
    height: clamp(104px, 11.5vh, 124px);
  }

  .school-logo-lg {
    width: clamp(148px, 18vh, 190px);
    height: clamp(148px, 18vh, 190px);
  }

  .auth-brand-title {
    font-size: clamp(1.32rem, 6vw, 1.7rem);
  }

  .auth-brand-subtitle {
    font-size: clamp(0.9rem, 4.2vw, 1.08rem);
    margin-bottom: 0;
  }

  .auth-right {
    padding: 0.65rem 0.65rem 0.75rem;
    overflow-y: auto;
  }

  .auth-form-container {
    padding: 1rem 0.9rem;
    border-radius: 16px;
  }

  .form-control,
  .form-select {
    padding: 0.78rem 0.92rem;
    font-size: 16px;
  }

  .form-label {
    font-size: 0.76rem;
  }

  .btn-primary-custom {
    padding: 0.82rem;
    font-size: 0.9rem;
  }

  .otp-input {
    letter-spacing: 5px;
    font-size: 1rem;
  }

  .form-check-label,
  .text-link {
    font-size: 0.82rem;
  }
}

@media (max-height: 820px) {
  .auth-left {
    padding: clamp(0.9rem, 2vh, 1.8rem) clamp(0.95rem, 2vw, 2rem);
  }

  .auth-left h1,
  .auth-left h2 {
    font-size: clamp(1.35rem, 2.7vw, 2.15rem);
    margin-bottom: 0.45rem;
  }

  .school-logo-lg {
    width: clamp(180px, 28vh, 260px);
    height: clamp(180px, 28vh, 260px);
  }

  .auth-form-container {
    padding: clamp(0.82rem, 1.45vh, 1.25rem);
  }

  .auth-form-container .mb-4 {
    margin-bottom: 0.75rem !important;
  }

  .auth-form-container .mb-3 {
    margin-bottom: 0.6rem !important;
  }

  .auth-form-container .mt-4 {
    margin-top: 0.75rem !important;
  }

  .auth-form-container h4 {
    font-size: clamp(1rem, 1.8vh, 1.25rem);
  }

  .auth-form-container .alert,
  .auth-inline-note {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }
}
