/* Login page (index.php). Self-contained; colours taken from the AFUED crest. */
:root {
  --afued-green: #1f6f3a;
  --afued-green-dark: #134a26;
  --afued-green-soft: #e8f3ec;
  --afued-red: #c62828;
  --ink: #1d2733;
  --muted: #5f6b7a;
  --line: #d9e0e7;
  --field: #f7f9fb;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body.login-page {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

.login-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- Brand panel (left) ---------- */
.login-brand {
  position: relative;
  flex: 1 1 52%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
  color: #fff;
  background:
    linear-gradient(160deg, rgba(19, 74, 38, 0.94) 0%, rgba(31, 111, 58, 0.88) 55%, rgba(19, 74, 38, 0.96) 100%),
    url("../images/background/background-1.png") center / cover no-repeat;
  overflow: hidden;
}

.login-brand::after {
  /* thin crest-red rule along the inner edge */
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: var(--afued-red);
}

.brand-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-top img {
  width: 58px;
  height: auto;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.brand-top .brand-name {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: 0.2px;
  opacity: 0.95;
}

.brand-middle h1 {
  margin: 0 0 14px;
  font-size: 38px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-middle p.lead {
  margin: 0 0 34px;
  max-width: 460px;
  font-size: 16px;
  line-height: 1.6;
  opacity: 0.88;
}

.brand-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
  max-width: 460px;
}

.brand-points li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.brand-points .point-icon {
  flex: 0 0 38px;
  height: 38px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 15px;
}

.brand-points strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
}

.brand-points span {
  font-size: 13.5px;
  line-height: 1.5;
  opacity: 0.82;
}

.brand-bottom {
  font-size: 12.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.7;
}

/* ---------- Form panel (right) ---------- */
.login-main {
  flex: 1 1 48%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 24px;
  background: #fff;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.mobile-brand {
  display: none;
  text-align: center;
  margin-bottom: 28px;
}

.mobile-brand img { width: 64px; height: auto; }

.mobile-brand .brand-name {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--afued-green-dark);
}

.login-card h2 {
  margin: 0 0 6px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.login-card .subtitle {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.login-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 22px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #fdecec;
  border: 1px solid #f5c2c2;
  color: #8c1d1d;
  font-size: 14px;
  line-height: 1.5;
}

.login-alert .alert-icon { margin-top: 2px; }

/* login_error() wraps the text in an h6; flatten it inside the alert */
.login-alert h6 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  text-align: left !important;
  color: inherit !important;
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

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

.input-wrap .input-icon {
  position: absolute;
  left: 14px;
  color: #8a96a3;
  font-size: 14px;
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.input-wrap input::placeholder { color: #9aa5b1; }

.input-wrap input:focus {
  outline: none;
  background: #fff;
  border-color: var(--afued-green);
  box-shadow: 0 0 0 3px rgba(31, 111, 58, 0.15);
}

.input-wrap.has-toggle input { padding-right: 70px; }

.toggle-password {
  position: absolute;
  right: 8px;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--afued-green);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.toggle-password:hover,
.toggle-password:focus-visible {
  background: var(--afued-green-soft);
  outline: none;
}

.field-hint {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

.btn-signin {
  width: 100%;
  height: 50px;
  margin-top: 6px;
  border: 0;
  border-radius: var(--radius);
  background: var(--afued-green);
  color: #fff;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.15s, transform 0.05s;
  box-shadow: 0 6px 16px rgba(31, 111, 58, 0.22);
}

.btn-signin:hover { background: var(--afued-green-dark); }
.btn-signin:active { transform: translateY(1px); }
.btn-signin:focus-visible { outline: 3px solid rgba(31, 111, 58, 0.35); outline-offset: 2px; }
.btn-signin[disabled] { opacity: 0.8; cursor: progress; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.btn-signin.is-loading .spinner { display: inline-block; }

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

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 20px;
  color: #9aa5b1;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.new-student {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}

.new-student:hover,
.new-student:focus-visible {
  border-color: var(--afued-green);
  background: var(--afued-green-soft);
  outline: none;
}

.new-student strong { display: block; font-size: 14.5px; }
.new-student span { font-size: 13px; color: var(--muted); }
.new-student .arrow { color: var(--afued-green); font-size: 14px; }

.help-text {
  margin-top: 22px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  text-align: center;
}

.login-footer {
  margin-top: 36px;
  font-size: 12.5px;
  color: #8a96a3;
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .login-brand { display: none; }
  .mobile-brand { display: block; }
  .login-main { padding: 36px 16px; }
}

@media (max-width: 400px) {
  .login-card h2 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 1.5s; }
  * { transition: none !important; }
}

/* ---------- New student page (newstudent.php) ---------- */
.level-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.level-choice input { position: absolute; opacity: 0; pointer-events: none; }
.level-choice label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.level-choice label span { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.level-choice input:checked + label {
  border-color: var(--afued-green);
  background: var(--afued-green-soft);
  box-shadow: 0 0 0 3px rgba(31, 111, 58, 0.12);
}
.level-choice input:focus-visible + label { outline: 3px solid rgba(31, 111, 58, 0.35); outline-offset: 2px; }

/* ---------- Change default password (admin/student changepassword.php) ---------- */
.gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #fff4e5;
  color: #8a4b00;
  font-size: 12.5px;
  font-weight: 600;
}
.password-rules {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  font-size: 12.5px;
  color: var(--muted);
}
.password-rules li { position: relative; padding-left: 18px; }
.password-rules li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #b5bec8;
}
.password-rules li.met { color: var(--afued-green); }
.password-rules li.met::before { background: var(--afued-green); border-color: var(--afued-green); }
@media (max-width: 400px) { .password-rules { grid-template-columns: 1fr; } }
.field-hint.hint-ok { color: var(--afued-green); }
.field-hint.hint-bad { color: var(--afued-red); }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.back-link:hover { color: var(--afued-red); }
