/* Compact login card - only affects the login page (index.php) */
body.auth-page .auth-wrapper { padding: 1rem; min-height: 100vh; }

body.auth-page :is(.login-card, .voter-card) { max-width: 380px; border-radius: 18px; }

body.auth-page :is(.login-card, .voter-card) .auth-header { padding: 1.4rem 1.6rem 0.8rem !important; margin-bottom: 0 !important; }
body.auth-page :is(.login-card, .voter-card) .auth-logo { margin-bottom: 0.4rem !important; }
body.auth-page :is(.login-card, .voter-card) .school-logo { width: 64px !important; }
body.auth-page :is(.login-card, .voter-card) .auth-header h1 { font-size: 1.15rem; line-height: 1.25; margin: 0 0 0.2rem; }
body.auth-page :is(.login-card, .voter-card) .subtitle { font-size: 0.95rem !important; }
body.auth-page :is(.login-card, .voter-card) .auth-description { font-size: 0.85rem; margin: 0.4rem 0 0; }

body.auth-page :is(.login-card, .voter-card) .auth-form { padding: 0 1.6rem 1rem; }
body.auth-page :is(.login-card, .voter-card) .input-group { margin-bottom: 0.8rem; }
body.auth-page :is(.login-card, .voter-card) .input-group label { font-size: 0.85rem; gap: 0.5rem; margin-bottom: 0.35rem; }
body.auth-page :is(.login-card, .voter-card) .input-icon { font-size: 1rem; width: 18px; }
body.auth-page :is(.login-card, .voter-card) .input-group input { padding: 0.6rem 0.9rem; font-size: 0.9rem; border-radius: 10px; }
body.auth-page :is(.login-card, .voter-card) .auth-btn { padding: 0.7rem 1.1rem; font-size: 0.95rem; margin-top: 0.8rem; border-radius: 10px; }

body.auth-page :is(.login-card, .voter-card) .auth-footer { padding: 0.9rem 1.6rem 1.2rem; }
body.auth-page :is(.login-card, .voter-card) .auth-footer h4 { font-size: 0.9rem; margin-bottom: 0.6rem; }
body.auth-page :is(.login-card, .voter-card) .register-options { margin-bottom: 0; gap: 0.5rem; }
body.auth-page :is(.login-card, .voter-card) .register-option { padding: 0.6rem 0.9rem; gap: 0.7rem; border-radius: 10px; }
body.auth-page :is(.login-card, .voter-card) .register-option .option-icon { font-size: 1.2rem; }
body.auth-page :is(.login-card, .voter-card) .register-option strong { font-size: 0.88rem; }
body.auth-page :is(.login-card, .voter-card) .register-option p { font-size: 0.75rem; margin: 0; }
body.auth-page :is(.login-card, .voter-card) .auth-alert { margin: 0 1.6rem 0.8rem; padding: 0.6rem 0.8rem; font-size: 0.85rem; }

/* short screens: tighten a bit more */
@media (max-height: 700px) {
  body.auth-page :is(.login-card, .voter-card) .school-logo { width: 52px !important; }
  body.auth-page :is(.login-card, .voter-card) .auth-description { display: none; }
}


/* ---------- "Register as Voter" as a text link ---------- */
body.auth-page .login-card .auth-footer.register-text {
  padding: 0.9rem 1.6rem 1.1rem; text-align: center; font-size: 0.88rem; color: #666;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem;
}
.register-link { color: var(--dark-maroon, #770000); font-weight: 700; text-decoration: none; border-bottom: 2px solid transparent; transition: all .2s ease; }
.register-link:hover { color: var(--golden-orange, #FFA726); border-bottom-color: currentColor; }

/* ---------- Voter registration modal ---------- */
body.modal-lock { overflow: hidden; }
.reg-modal {
  position: fixed; inset: 0; z-index: 3000; display: none; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(40, 0, 0, 0.55); backdrop-filter: blur(3px); overflow-y: auto;
}
.reg-modal.open { display: flex; animation: regFade .2s ease; }
.reg-modal-box {
  position: relative; width: 100%; max-width: 540px; max-height: 94vh; overflow-y: auto;
  background: #fffaf5; border-radius: 18px; padding: 1.4rem 1.6rem 1.2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,.4); border-top: 5px solid #FFB300;
  animation: regPop .25s ease;
}
.reg-close {
  position: absolute; top: .5rem; right: .8rem; width: 34px; height: 34px; border: none; background: transparent;
  font-size: 1.8rem; line-height: 1; color: #888; cursor: pointer; border-radius: 50%; transition: all .2s ease;
}
.reg-close:hover { background: rgba(0,0,0,.07); color: #770000; }
.reg-head { text-align: center; margin-bottom: .8rem; }
.reg-icon { font-size: 2rem; line-height: 1; }
.reg-head h3 { margin: .3rem 0 .1rem; font-size: 1.3rem; color: var(--dark-maroon, #770000); font-weight: 800; }
.reg-head p { margin: 0; font-size: .85rem; color: #777; }

.reg-modal .auth-form { padding: 0 !important; }
.reg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .9rem; }
.reg-modal .input-group { margin-bottom: .7rem; }
.reg-modal .input-group label { font-size: .82rem; gap: .4rem; margin-bottom: .3rem; }
.reg-modal .input-icon { font-size: .95rem; width: 16px; }
.reg-modal .input-group input { padding: .55rem .8rem; font-size: .88rem; border-radius: 10px; }
.reg-modal .password-field input { padding-right: 2.4rem; }
.reg-modal .auth-alert { margin: 0 0 .8rem; padding: .6rem .8rem; font-size: .85rem; }
.reg-submit { padding: .75rem 1.1rem !important; font-size: .95rem !important; margin-top: .4rem !important; border-radius: 10px !important; }
.reg-back { text-align: center; font-size: .85rem; color: #666; margin: .8rem 0 0; }
.reg-back a { color: var(--dark-maroon, #770000); font-weight: 700; text-decoration: none; }
.reg-back a:hover { text-decoration: underline; }

@keyframes regFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes regPop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 520px) {
  .reg-modal { padding: .5rem; align-items: flex-start; }
  .reg-modal-box { padding: 1.1rem 1rem; max-height: 98vh; margin-top: .3rem; }
  .reg-grid { grid-template-columns: 1fr; }
}


/* ---------- Neat notification boxes (login + modal) ---------- */
body.auth-page .login-card > .auth-alert,
.reg-modal .auth-alert {
  display: flex; align-items: center; gap: .65rem;
  margin: 0 1.6rem .9rem; padding: .6rem .85rem;
  border-radius: 10px; border-left-width: 4px; text-align: left;
  font-size: .85rem; line-height: 1.35; box-shadow: none;
}
.reg-modal .auth-alert { margin: 0 0 .8rem; }
body.auth-page .login-card > .auth-alert .alert-icon,
.reg-modal .auth-alert .alert-icon {
  flex: 0 0 auto; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1rem; margin: 0; line-height: 1;
}
body.auth-page .login-card > .auth-alert strong,
.reg-modal .auth-alert strong { display: block; font-size: .88rem; margin: 0; }
body.auth-page .login-card > .auth-alert p,
.reg-modal .auth-alert p { margin: .1rem 0 0; font-size: .8rem; font-weight: 500; opacity: .9; line-height: 1.3; }
body.auth-page .login-card > .auth-alert { transition: opacity .3s ease; animation: regPop .25s ease; }


/* ---------- Floating toast ---------- */
.toast-float {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 4000; width: calc(100% - 28px); max-width: 380px;
  display: flex; align-items: center; gap: .75rem;
  padding: .8rem 2.4rem .8rem .9rem; border-radius: 14px; overflow: hidden;
  background: #ffffff; color: #1b4d1f;
  box-shadow: 0 12px 35px rgba(0,0,0,.28), 0 0 0 1px rgba(76,175,80,.25);
  border-left: 5px solid #4CAF50;
  animation: toastIn .45s cubic-bezier(.2,.9,.3,1.2) both;
}
.toast-float.hide { animation: toastOut .35s ease forwards; }
.toast-icon {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #4CAF50; color: #fff; font-weight: 800; font-size: 1rem;
}
.toast-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.toast-text strong { font-size: .92rem; color: #2E7D32; }
.toast-text span { font-size: .8rem; color: #555; }
.toast-close {
  position: absolute; top: 6px; right: 8px; width: 24px; height: 24px; border: none; background: transparent;
  font-size: 1.3rem; line-height: 1; color: #999; cursor: pointer; border-radius: 50%;
}
.toast-close:hover { background: rgba(0,0,0,.07); color: #333; }
.toast-bar {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: linear-gradient(90deg, #66BB6A, #2E7D32); transform-origin: left;
  animation: toastBar 5s linear forwards;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -30px) scale(.95); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, -20px) scale(.97); } }
@keyframes toastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* grade / section selects in registration */
.reg-modal .input-group select, .auth-form .input-group select { width: 100%; padding: .55rem .8rem; font-size: .88rem; border-radius: 10px; border: 2px solid #e0e0e0; background: #fff; font-family: inherit; }
.reg-modal .input-group select:focus, .auth-form .input-group select:focus { outline: none; border-color: #ffb300; }

/* Optional candidacy section in the Register form */
.cand-box { grid-column: 1 / -1; margin: .4rem 0 .9rem; padding: .7rem .9rem; border: 1px dashed #c9a227; border-radius: 10px; background: rgba(255, 193, 7, .08); }
.cand-toggle { display: flex; align-items: center; gap: .55rem; cursor: pointer; font-weight: 600; }
.cand-toggle input { width: auto; margin: 0; }
.cand-fields { margin-top: .7rem; }
.cand-fields textarea, .cand-fields select, .cand-fields input[type=file] { width: 100%; box-sizing: border-box; }
.cand-fields textarea { resize: vertical; min-height: 70px; }

/* Candidacy section: make fonts/inputs match the rest of the registration form */
.cand-box, .cand-box label, .cand-box span, .cand-box input, .cand-box select, .cand-box textarea, .cand-box button {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.cand-toggle { font-size: .9rem; color: var(--dark-gray, #333); }
.cand-toggle input[type=checkbox] { width: 16px; height: 16px; flex: 0 0 auto; accent-color: #7a0000; }
.cand-fields .input-group label { font-size: .82rem; font-weight: 600; }
.cand-fields textarea,
.cand-fields input[type=file] {
  width: 100%; box-sizing: border-box;
  padding: .55rem .8rem; font-size: .88rem; line-height: 1.4; font-weight: 400;
  border: 2px solid #e0e0e0; border-radius: 10px; background: #fff; color: inherit;
}
.cand-fields textarea { min-height: 80px; resize: vertical; display: block; }
.cand-fields textarea::placeholder { font-family: inherit; font-size: .88rem; font-style: italic; color: #9a9a9a; }
.cand-fields textarea:focus, .cand-fields input[type=file]:focus { outline: none; border-color: #ffb300; }
.cand-fields input[type=file]::file-selector-button {
  font-family: inherit; font-size: .82rem; font-weight: 600; color: #fff; background: #7a0000;
  border: none; border-radius: 8px; padding: .35rem .8rem; margin-right: .7rem; cursor: pointer;
}
.cand-fields input[type=file]::file-selector-button:hover { background: #5c0000; }


/* Forgot password link + page */
.forgot-row { text-align: right; margin: -.2rem 0 .9rem; }
.forgot-link { font-size: .82rem; font-weight: 600; color: var(--dark-maroon, #770000); text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }
.fp-hint { font-size: .82rem; color: #666; margin: 0 0 .9rem; padding: 0 1.6rem; line-height: 1.5; text-align: center; }
.fp-found { margin: 0 1.6rem 1rem; text-align: center; padding: .8rem 1rem; border-radius: 10px; background: rgba(255,193,7,.12); border: 1px dashed #c9a227; font-size: .9rem; }
.fp-found div { margin: .15rem 0; }
.fp-found b { color: var(--dark-maroon, #770000); }

/* Forgot password page: keep the buttons/alerts aligned with the form */
body.auth-page .login-card > .auth-alert { margin-left: 1.6rem; margin-right: 1.6rem; }
body.auth-page .login-card > .success-actions { padding: 0 1.6rem 1.2rem; }

/* Student/Admin tabs on the Forgot Password page are links */
.fp-switch { margin: 0 1.6rem 1rem; }
.fp-switch .ls-btn { text-decoration: none; }

/* Forgot-password pages only have Student/Admin: keep two equal columns */
.login-switch.fp-switch { grid-template-columns: repeat(2, 1fr); }
