:root {
  --primary-red: #a1122a;
  --dark-red: #6a0c1c;
  --gradient-red: linear-gradient(135deg, #a1122a 0%, #6a0c1c 100%);
  --gold-accent: #d4af37;
  --bg-cream: #f8f5f1;
}

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

html, body {
  height: 100%;
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: url("../assets/img/stsnschool.jpg") no-repeat center / cover fixed;
  overflow-x: hidden;
}

body {
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 0;
}

.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.35);
  transition: background .3s;
}

.navbar.scrolled {
  background: var(--primary-red);
}

.main-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: clamp(1rem, 4vw, 2rem);
  padding-top: clamp(100px, 12vh, 140px);
}

.split-card {
  width: 100%;
  max-width: 800px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,.45);
  display: flex;
  animation: slideUp .8s cubic-bezier(.2,.8,.2,1);
}

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

.login-side,
.info-side {
  flex: 1;
  padding: clamp(2rem, 5vw, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-side {
  background: #ffffff;
}

.school-branding {
  text-align: center;
  margin-bottom: 2rem;
}

.school-logo {
  width: clamp(60px, 10vw, 85px);
  margin-bottom: 1rem;
}

.login-title {
  color: var(--primary-red);
  font-weight: 700;
  font-size: clamp(1.4rem, 4vw, 1.75rem);
  margin: 0 0 .25rem;
}

.form-floating > .form-control {
  border-radius: 12px;
  border: 1px solid #e9ecef;
  background: #f8f9fa;
  font-size: .95rem;
}

.form-floating > .form-control:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 4px rgba(161,18,42,.15);
  background: #fff;
}

.btn-login {
  background: var(--gradient-red);
  border: none;
  padding: .85rem;
  font-weight: 600;
  border-radius: 12px;
  color: #fff;
  width: 100%;
  transition: all .3s ease;
  position: relative;
  height: 50px;
  min-height: 50px;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(161,18,42,.3);
}

.btn-login:disabled,
.btn-login.loading {
  opacity: .92;
  cursor: not-allowed;
}

.btn-login.loading:hover,
.btn-login:disabled:hover {
  transform: none;
  box-shadow: none;
}

.btn-text,
.btn-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
}

.btn-loading {
  display: none;
}

.btn-login.loading .btn-text {
  display: none;
}

.btn-login.loading .btn-loading {
  display: inline-flex;
}

.login-loader {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

.info-side {
  background: var(--gradient-red);
  color: #fff;
  position: relative;
}

.decorative-circle {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
  pointer-events: none;
}

.vm-box {
  background: rgba(255,255,255,.12);
  border-left: 4px solid var(--gold-accent);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  border-radius: 0 12px 12px 0;
  backdrop-filter: blur(8px);
  transition: transform .3s ease;
}

.vm-box:hover {
  transform: translateX(8px);
}

.vm-title {
  font-weight: 700;
  color: var(--gold-accent);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-size: .85rem;
  margin-bottom: .5rem;
}

.vm-text {
  font-size: .85rem;
  line-height: 1.6;
  opacity: .95;
}

.info-footer {
  margin-top: 2rem;
  border-top: 1px solid rgba(255,255,255,.25);
  padding-top: 1.5rem;
  font-size: .8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}


#js-alert-container,
#php-alert-wrapper {
  min-height: 0;
}

.alert-login {
  border: none;
  border-left: 4px solid var(--primary-red);
  border-radius: 12px;
  padding: .85rem 1rem;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  box-shadow: 0 8px 18px rgba(0,0,0,.08);
  animation: fadeInDown .25s ease;
}

.alert-login i {
  font-size: 1rem;
  flex-shrink: 0;
}

.alert-login.alert-danger {
  background: #fff1f3;
  color: #7a1022;
}

.alert-login.alert-success {
  background: #eefaf1;
  color: #166534;
  border-left-color: #198754;
}

.alert-login.alert-warning {
  background: #fff8e6;
  color: #8a5a00;
  border-left-color: #d4af37;
}

.fade-out {
  opacity: 0;
  transform: translateY(-8px);
  transition: all .35s ease;
}

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

@media (max-width: 768px) {
  .split-card {
    flex-direction: column;
    max-width: 480px;
  }

  .decorative-circle {
    display: none;
  }

  .navbar {
    background: var(--primary-red);
  }
}

@media (max-width: 575.98px) {
  html,
  body {
    min-height: 100%;
    height: auto;
    background-attachment: scroll;
  }

  .main-wrapper {
    align-items: flex-start;
    min-height: 100dvh;
    padding: 5.25rem .75rem 1rem;
  }
}
