/* ==========================================================================
   Soujanaars - sign-in + "choose" pages (Lofthela-style auth on the crest colours)
   ========================================================================== */
:root {
  --primary: 15, 37, 87;
  --danger: 214, 32, 40;
  --sj-green: #0f2557; --sj-green-dark: #0a1a3d; --sj-red: #d4141c; --sj-gold: #ffffff;
  --sj-ink: #0b1220; --sj-ink-2: #4a5568; --sj-line: rgba(11, 18, 32, .1);
  --sj-ease: cubic-bezier(.22, 1, .36, 1);
  --sj-grad: linear-gradient(135deg, #1e3a8a 0%, #0a1a3d 100%);
}
html[data-sj-section="ecde"] { --sj-grad: linear-gradient(135deg, #d4141c 0%, #9b1016 100%); }
* { box-sizing: border-box; }
body.sj-auth { margin: 0; min-height: 100vh; font-family: "Lexend Deca", system-ui, sans-serif; color: var(--sj-ink); background: #eef1f7; -webkit-font-smoothing: antialiased; }
.sj-auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 44%) 1fr; }

/* ---------- brand panel ---------- */
.sj-auth-brand { position: relative; overflow: hidden; color: #fff; display: flex; align-items: center; justify-content: center; padding: 3rem 2.5rem;
  background: radial-gradient(110% 80% at 100% 0%, rgba(255, 255, 255, .14) 0%, transparent 50%),
              radial-gradient(90% 70% at 0% 100%, rgba(212, 20, 28, .35) 0%, transparent 55%),
              linear-gradient(150deg, #0a1a3d 0%, #0f2557 55%, #1e3a8a 100%); }
html[data-sj-section="ecde"] .sj-auth-brand { background: radial-gradient(110% 80% at 100% 0%, rgba(255, 255, 255, .16) 0%, transparent 50%),
              radial-gradient(90% 70% at 0% 100%, rgba(15, 37, 87, .55) 0%, transparent 55%),
              linear-gradient(150deg, #8f1016 0%, #c8161e 55%, #a3121a 100%); }
.sj-auth-brand::before { content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='76' viewBox='0 0 44 76'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.10' stroke-width='1.2'%3E%3Cpolygon points='0,-24 20.8,-12 20.8,12 0,24 -20.8,12 -20.8,-12'/%3E%3Cpolygon points='44,-24 64.8,-12 64.8,12 44,24 23.2,12 23.2,-12'/%3E%3Cpolygon points='22,14 42.8,26 42.8,50 22,62 1.2,50 1.2,26'/%3E%3Cpolygon points='0,52 20.8,64 20.8,88 0,100 -20.8,88 -20.8,64'/%3E%3Cpolygon points='44,52 64.8,64 64.8,88 44,100 23.2,88 23.2,64'/%3E%3C/g%3E%3C/svg%3E") repeat 0 0 / 44px 76px;
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 75%); mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 75%); }
.sj-orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; pointer-events: none; animation: sj-float 14s ease-in-out infinite alternate; }
.sj-orb.one { width: 320px; height: 320px; background: #2b4fa8; top: -110px; left: -90px; }
.sj-orb.two { width: 280px; height: 280px; background: var(--sj-red); bottom: -110px; right: -70px; animation-delay: -5s; opacity: .45; }
.sj-orb.three { width: 200px; height: 200px; background: var(--sj-gold); top: 42%; left: 62%; opacity: .25; animation-delay: -9s; }
@keyframes sj-float { from { transform: translate(0, 0) scale(1); } to { transform: translate(36px, 26px) scale(1.12); } }
.sj-auth-brand-inner { position: relative; z-index: 1; max-width: 420px; text-align: center; animation: sj-rise .9s var(--sj-ease) both; }
.sj-auth-crest { width: 168px; height: 168px; margin: 0 auto 1.25rem; border-radius: 50%; background: #fff; padding: 14px; position: relative;
  box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .55), 0 0 0 8px rgba(255, 255, 255, .12); }
.sj-auth-crest::after { content: ""; position: absolute; inset: -16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); animation: sj-pulse 2.8s ease-out infinite; }
.sj-auth-crest img { width: 100%; height: 100%; object-fit: contain; display: block; }
@keyframes sj-pulse { 0% { transform: scale(.92); opacity: 1; } 100% { transform: scale(1.18); opacity: 0; } }
.sj-auth-school { font-family: "Sora", sans-serif; font-weight: 800; font-size: 2rem; letter-spacing: -.01em; margin: 0; color: #fff; }
.sj-auth-place { margin: .35rem 0 1rem; color: rgba(255, 255, 255, .8); font-size: .9rem; }
.sj-auth-motto { display: inline-flex; flex-direction: column; gap: 2px; padding: .65rem 1.4rem; border-radius: 14px; background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(6px); }
.sj-auth-motto span { font-family: "Sora", sans-serif; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; font-size: .95rem; }
.sj-auth-motto em { font-style: normal; font-size: .78rem; color: rgba(255, 255, 255, .85); letter-spacing: .04em; }
.sj-auth-badges { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1.25rem; }
.sj-auth-badges span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: rgba(0, 0, 0, .18); border: 1px solid rgba(255, 255, 255, .18); }
.sj-auth-points { list-style: none; padding: 0; margin: 1.75rem auto 0; text-align: left; display: inline-flex; flex-direction: column; gap: .6rem; font-size: .88rem; color: rgba(255, 255, 255, .9); }
.sj-auth-points i { width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .14); margin-right: 8px; }

/* ---------- form side ---------- */
.sj-auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2.5rem 1.5rem 1.5rem; position: relative;
  background: radial-gradient(60% 50% at 100% 0%, rgba(15, 37, 87, .08), transparent 60%), radial-gradient(50% 40% at 0% 100%, rgba(212, 20, 28, .06), transparent 60%), #f3f5fa; }
.sj-auth-card { width: 100%; max-width: 440px; background: rgba(255, 255, 255, .92); border-radius: 26px; padding: 2.1rem 2.1rem 1.8rem;
  box-shadow: 0 30px 70px -26px rgba(11, 18, 32, .38); border: 1px solid rgba(255, 255, 255, .8); animation: sj-rise .8s var(--sj-ease) both; }
.sj-auth-wrap.is-wide .sj-auth-card { max-width: 760px; }
@keyframes sj-rise { from { opacity: 0; transform: translateY(26px) scale(.985); } to { opacity: 1; transform: none; } }
.sj-auth-foot { margin: 1.5rem 0 0; font-size: .76rem; color: var(--sj-ink-2); text-align: center; }
.sj-auth-mobile-brand { display: none; }

.sj-auth-icon { width: 58px; height: 58px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 28px; color: #fff; background: var(--sj-grad);
  box-shadow: 0 14px 28px -12px rgba(15, 37, 87, .7); margin-bottom: 1rem; }
html[data-sj-section="ecde"] .sj-auth-icon { box-shadow: 0 14px 28px -12px rgba(200, 22, 30, .6); }
.sj-auth-title { font-family: "Sora", sans-serif; font-weight: 800; font-size: 1.6rem; letter-spacing: -.02em; margin: 0 0 .25rem; color: var(--sj-ink); }
.sj-auth-title .sj-grad-text { background: var(--sj-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sj-auth-sub { color: var(--sj-ink-2); font-size: .92rem; margin: 0 0 1.5rem; }
.sj-stagger > * { animation: sj-rise .7s var(--sj-ease) both; }
.sj-stagger > *:nth-child(2) { animation-delay: .06s; } .sj-stagger > *:nth-child(3) { animation-delay: .12s; } .sj-stagger > *:nth-child(4) { animation-delay: .18s; }
.sj-stagger > *:nth-child(5) { animation-delay: .24s; } .sj-stagger > *:nth-child(6) { animation-delay: .30s; } .sj-stagger > *:nth-child(7) { animation-delay: .36s; }

.sj-auth .form-label { font-size: .78rem; font-weight: 600; color: rgba(11, 18, 32, .78); margin-bottom: .35rem; }
.sj-field { position: relative; }
.sj-field > .sj-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 18px; color: #7a8599; pointer-events: none; transition: color .2s; z-index: 3; }
.sj-field .form-control, .sj-field .form-select { height: 50px; border-radius: 14px; padding: 0 44px 0 44px; font-size: 14.5px; font-weight: 500; color: var(--sj-ink);
  background-color: #fff; border: 1.5px solid rgba(11, 18, 32, .12); transition: border-color .2s, box-shadow .2s; }
.sj-field .form-select { padding-right: 2.4rem; }
.sj-field .form-control:focus, .sj-field .form-select:focus { border-color: var(--sj-green); box-shadow: 0 0 0 4px rgba(15, 37, 87, .13); }
.sj-field:focus-within > .sj-ico { color: var(--sj-green); }
.sj-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; width: 36px; height: 36px; border-radius: 10px;
  color: #7a8599; font-size: 18px; display: flex; align-items: center; justify-content: center; z-index: 4; }
.sj-eye:hover { background: rgba(15, 37, 87, .08); color: var(--sj-green); }

.sj-btn { height: 52px; border: 0; border-radius: 14px; font-weight: 700; font-size: 15px; color: #fff; background: var(--sj-grad); display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  box-shadow: 0 16px 30px -14px rgba(15, 37, 87, .75); transition: transform .2s, box-shadow .2s, filter .2s; width: 100%; text-decoration: none; }
.sj-btn:hover { color: #fff; transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 20px 34px -14px rgba(15, 37, 87, .85); }
.sj-btn:active { transform: none; }
.sj-btn-ghost { display: inline-flex; align-items: center; gap: .35rem; color: var(--sj-ink-2); font-weight: 600; font-size: .85rem; text-decoration: none; padding: .45rem .8rem; border-radius: 10px; }
.sj-btn-ghost:hover { background: rgba(15, 37, 87, .08); color: var(--sj-green); }
.sj-auth .alert { border: 0; border-radius: 14px; font-size: .88rem; display: flex; gap: .55rem; align-items: flex-start; }
.sj-auth .alert-danger { background: rgba(214, 32, 40, .09); color: #8a1218; }
.sj-auth .alert-danger i { color: var(--sj-red); font-size: 1.15rem; }
.sj-divider { display: flex; align-items: center; gap: .75rem; color: var(--sj-ink-2); font-size: .78rem; margin: 1.25rem 0; }
.sj-divider::before, .sj-divider::after { content: ""; flex: 1; height: 1px; background: var(--sj-line); }

/* choice buttons (choose subject / class) */
.sj-choice-list { display: grid; gap: .6rem; }
.sj-choice { display: flex; align-items: center; gap: .85rem; width: 100%; padding: .9rem 1rem; border-radius: 14px; border: 1.5px solid rgba(11, 18, 32, .1); background: #fff;
  font-weight: 600; color: var(--sj-ink); text-align: left; transition: all .2s; font-size: .95rem; }
.sj-choice:hover { border-color: var(--sj-green); box-shadow: 0 10px 22px -14px rgba(15, 37, 87, .6); transform: translateY(-1px); }
.sj-choice .sj-choice-ico { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; background: rgba(15, 37, 87, .1); color: var(--sj-green); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.sj-choice .ti-chevron-right { margin-left: auto; color: #9aa3b5; }

/* portal: role cards */
.sj-roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.sj-role { position: relative; display: flex; flex-direction: column; gap: .35rem; padding: 1.1rem 1.1rem 1rem; border-radius: 18px; border: 1.5px solid rgba(11, 18, 32, .08);
  background: #fff; text-decoration: none; color: var(--sj-ink); transition: transform .2s, box-shadow .2s, border-color .2s; overflow: hidden; }
.sj-role:hover { transform: translateY(-3px); border-color: transparent; box-shadow: 0 22px 40px -22px rgba(11, 18, 32, .5); color: var(--sj-ink); }
.sj-role .sj-role-ico { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 23px; color: #fff; margin-bottom: .35rem; }
.sj-role strong { font-family: "Sora", sans-serif; font-size: 1rem; }
.sj-role span { font-size: .8rem; color: var(--sj-ink-2); line-height: 1.45; }
.sj-role .sj-role-go { position: absolute; top: 1rem; right: 1rem; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(11, 18, 32, .05); color: var(--sj-ink-2); transition: all .2s; }
.sj-role:hover .sj-role-go { background: var(--sj-green); color: #fff; transform: rotate(-45deg); }
.sj-role.r-admin .sj-role-ico { background: linear-gradient(135deg, #1e3a8a, #0a1a3d); }
.sj-role.r-subject .sj-role-ico { background: linear-gradient(135deg, #3b63c4, #1e3a8a); }
.sj-role.r-class .sj-role-ico { background: linear-gradient(135deg, #3b4252, #0b0f19); }
.sj-role.r-finance .sj-role-ico { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.sj-section-switch { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(15, 37, 87, .07); border: 1px solid rgba(15, 37, 87, .12); }
.sj-section-switch a { padding: 7px 16px; border-radius: 999px; font-size: .82rem; font-weight: 600; color: var(--sj-ink-2); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.sj-section-switch a.active { background: #fff; color: var(--sj-green); box-shadow: 0 2px 8px rgba(11, 18, 32, .12); }
html[data-sj-section="ecde"] .sj-section-switch a.active { color: var(--sj-red); }
.sj-mv { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin-top: 1.4rem; }
.sj-mv div { padding: 1rem 1.1rem; border-radius: 16px; background: rgba(15, 37, 87, .05); border: 1px dashed rgba(15, 37, 87, .2); }
.sj-mv h6 { font-family: "Sora", sans-serif; font-weight: 700; font-size: .85rem; margin: 0 0 .35rem; color: var(--sj-green); display: flex; align-items: center; gap: 6px; }
.sj-mv p { margin: 0; font-size: .8rem; color: var(--sj-ink-2); line-height: 1.55; }

.f-s-12 { font-size: 12px; } .f-w-500 { font-weight: 500; } .f-w-600 { font-weight: 600; }

/* ---------- tablets + phones ---------- */
@media (max-width: 991.98px) {
  .sj-auth-wrap { grid-template-columns: 1fr; }
  .sj-auth-brand { display: none; }
  .sj-auth-main { justify-content: flex-start; padding: 1.25rem 1rem 1.25rem; min-height: 100vh;
    background: radial-gradient(120% 45% at 50% 0%, rgba(15, 37, 87, .22), transparent 70%), #f3f5fa; }
  html[data-sj-section="ecde"] .sj-auth-main { background: radial-gradient(120% 45% at 50% 0%, rgba(212, 20, 28, .18), transparent 70%), #f7f3f4; }
  .sj-auth-mobile-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem; margin: .75rem 0 1.25rem; animation: sj-rise .7s var(--sj-ease) both; }
  .sj-auth-mobile-brand img { width: 92px; height: 92px; border-radius: 50%; background: #fff; padding: 6px; box-shadow: 0 14px 30px -14px rgba(11, 18, 32, .45); object-fit: contain; }
  .sj-auth-mobile-brand strong { display: block; font-family: "Sora", sans-serif; font-weight: 800; font-size: 1.25rem; color: var(--sj-ink); }
  .sj-auth-mobile-brand span { display: block; font-size: .8rem; color: var(--sj-ink-2); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
}
@media (max-width: 575.98px) {
  .sj-auth-card { padding: 1.5rem 1.15rem 1.25rem; border-radius: 22px; }
  .sj-auth-title { font-size: 1.35rem; }
  .sj-roles, .sj-mv { grid-template-columns: 1fr; }
  .sj-role { flex-direction: row; align-items: center; gap: .85rem; padding: .9rem; }
  .sj-role .sj-role-ico { margin: 0; flex: 0 0 46px; }
  .sj-role .sj-role-go { position: static; margin-left: auto; flex: 0 0 30px; }
  .sj-role > div { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .sj-orb, .sj-auth-crest::after, .sj-stagger > *, .sj-auth-card, .sj-auth-brand-inner { animation: none; } }

/* Pop-ups (e.g. "Forgot password?"): the entry animation kept the sign-in card in its own layer, so the pop-up
   inside it sat under the dark backdrop and could not be clicked. While a pop-up is open the animation is dropped. */
body.modal-open .sj-auth-card,
body.modal-open .sj-stagger > *,
body.modal-open .sj-auth-mobile-brand { animation: none !important; transform: none !important; opacity: 1 !important; }
.modal { z-index: 1060; }
.modal-backdrop { z-index: 1050; }
