/* IFM-style form + safu ya kushoto kama srms.ac.tz/st_login.php */

.st-login-react-body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #ffffff;
  color: #64748b;
}

#st-login-root {
  width: 100%;
  min-height: 100vh;
}

.ems-main {
  width: 100%;
  min-height: 100vh;
  color: #64748b;
}

/* Safu mbili: maelezo (kushoto / juu kwenye simu) + fomu */
.ems-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 960px) {
  .ems-layout {
    flex-direction: row;
    align-items: stretch;
  }
}

.ems-sidebar {
  flex: 0 0 auto;
  padding: 1.5rem 1.25rem 1.75rem;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
  box-sizing: border-box;
}

@media (min-width: 960px) {
  .ems-sidebar {
    flex: 1 1 42%;
    max-width: 32rem;
    min-width: min(100%, 18rem);
    border-bottom: 0;
    border-right: 1px solid #e2e8f0;
    padding: 2.25rem 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

.ems-sidebar-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
}

.ems-lang-btn {
  margin: 0;
  padding: 0.2rem 0.45rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: #175883;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.ems-lang-btn:hover {
  background: rgba(23, 88, 131, 0.08);
}

.ems-lang-btn.is-active {
  background: rgba(23, 88, 131, 0.12);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ems-toolbar-sep {
  color: #cbd5e1;
  user-select: none;
  margin: 0 0.15rem;
}

.ems-theme-btn {
  margin: 0;
  padding: 0.2rem 0.45rem;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #175883;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.ems-theme-btn:hover {
  background: rgba(23, 88, 131, 0.08);
}

.ems-sidebar-title {
  margin: 0 0 1rem;
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 800;
  line-height: 1.25;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.ems-sidebar-intro {
  margin: 0 0 1.35rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #475569;
}

.ems-auth {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.5rem 1rem 2rem;
  box-sizing: border-box;
  min-width: 0;
}

@media (min-width: 640px) {
  .ems-auth {
    justify-content: center;
    padding-top: 1rem;
  }
}

.ems-auth-inner {
  width: 100%;
  max-width: 28rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ems-top {
  text-align: center;
  z-index: 10;
}

.ems-logo-img {
  display: block;
  width: auto;
  max-height: 9rem;
  max-width: min(100%, 14rem);
  margin: 0 auto;
  padding: 1.5rem 0;
  object-fit: contain;
}

/* Matches IFM’s hidden institution block (logo only visible) */
.ems-institution--sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ems-institution-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
}

@media (min-width: 1024px) {
  .ems-institution-title {
    font-size: 1.25rem;
  }
}

.ems-institution-slogan {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  font-style: italic;
}

/* Double-frame card (IFM) */
.ems-card-outer {
  border: 1px solid #e2e8f0;
  border-radius: 1.5rem;
  padding: 0.375rem;
  margin-top: 0.75rem;
  background: rgba(226, 232, 240, 0.3);
  width: 100%;
  max-width: 28rem;
  box-sizing: border-box;
}

.ems-card-inner {
  border: 1px solid #e2e8f0;
  width: 100%;
  max-width: 28rem;
  padding: 1.5rem;
  background: #fff;
  border-radius: 1rem;
  box-sizing: border-box;
}

.ems-welcome {
  margin-bottom: 0.75rem;
  width: 100%;
}

.ems-welcome-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  color: #0f172a;
}

.ems-welcome-sub {
  margin: 0;
  font-size: 0.875rem;
  text-align: center;
  line-height: 1.5;
  color: #64748b;
}

.ems-form-wrap {
  color: #64748b;
}

.ems-form {
  margin: 0;
}

.ems-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.ems-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25;
  color: #64748b;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ems-input::placeholder {
  color: #94a3b8;
  opacity: 1;
}

.ems-input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(191, 219, 254, 0.5);
}

.ems-field-gap {
  margin-top: 1rem;
}

.ems-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.ems-remember-block {
  flex: 1 1 auto;
  min-width: 0;
}

.ems-remember-label {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 500;
  color: #64748b;
  line-height: 1;
  cursor: pointer;
  margin: 0;
}

.ems-checkbox {
  width: 1rem;
  height: 1rem;
  margin: 0;
  flex-shrink: 0;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  accent-color: #175883;
}

.ems-remember-text {
  margin-left: 0.5rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: #64748b;
}

.ems-forgot {
  font-size: 0.875rem;
  text-decoration: underline;
  color: inherit;
  white-space: nowrap;
}

.ems-forgot:hover {
  color: #175883;
}

/* “Forgot password” — haiongozi ukurasa mwingine */
.ems-forgot-static {
  font-size: 0.875rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  color: inherit;
  white-space: nowrap;
  cursor: default;
  pointer-events: none;
  user-select: none;
}

.ems-submit {
  margin-top: 1rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background-color: #175883;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.ems-submit:hover {
  background-color: #12486a;
}

.ems-submit:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 88, 131, 0.35);
}

.ems-submit:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.ems-alert {
  margin-bottom: 0.75rem;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.375rem;
}

.ems-quick-links {
  z-index: 10;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: #94a3b8;
}

.ems-quick-links-inner {
  margin: 0;
  text-align: center;
}

.ems-link {
  margin: 0 0.25rem;
  text-decoration: none;
  color: #3b82f6;
  font-weight: 500;
}

.ems-link:hover {
  text-decoration: underline;
}

/* Maandishi yanayofanana na viungo lakini hayana urambazaji */
.ems-link-static {
  margin: 0 0.25rem;
  color: #3b82f6;
  font-weight: 500;
  cursor: default;
  pointer-events: none;
  user-select: none;
}

.ems-link-sep {
  color: #94a3b8;
  margin: 0 0.25rem;
  user-select: none;
}

.ems-copyright {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.45;
}

/* ——— Hali ya giza (Dark mode) ——— */
.st-login-react-body--dark {
  background: #0f172a;
  color: #94a3b8;
}

.st-login-react-body--dark .ems-main {
  color: #94a3b8;
}

.st-login-react-body--dark .ems-sidebar {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-bottom-color: #334155;
  border-right-color: #334155;
}

.st-login-react-body--dark .ems-sidebar-title,
.st-login-react-body--dark .ems-welcome-title {
  color: #f1f5f9;
}

.st-login-react-body--dark .ems-sidebar-intro,
.st-login-react-body--dark .ems-welcome-sub {
  color: #94a3b8;
}

.st-login-react-body--dark .ems-lang-btn,
.st-login-react-body--dark .ems-theme-btn {
  color: #7dd3fc;
}

.st-login-react-body--dark .ems-lang-btn:hover,
.st-login-react-body--dark .ems-theme-btn:hover {
  background: rgba(125, 211, 252, 0.12);
}

.st-login-react-body--dark .ems-lang-btn.is-active {
  background: rgba(125, 211, 252, 0.18);
}

.st-login-react-body--dark .ems-toolbar-sep {
  color: #475569;
}

.st-login-react-body--dark .ems-auth {
  background: transparent;
}

.st-login-react-body--dark .ems-card-outer {
  border-color: #334155;
  background: rgba(30, 41, 59, 0.5);
}

.st-login-react-body--dark .ems-card-inner {
  border-color: #334155;
  background: #1e293b;
}

.st-login-react-body--dark .ems-form-wrap,
.st-login-react-body--dark .ems-label,
.st-login-react-body--dark .ems-remember-label,
.st-login-react-body--dark .ems-remember-text {
  color: #94a3b8;
}

.st-login-react-body--dark .ems-input {
  color: #e2e8f0;
  background: #0f172a;
  border-color: #475569;
}

.st-login-react-body--dark .ems-input::placeholder {
  color: #64748b;
}

.st-login-react-body--dark .ems-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.st-login-react-body--dark .ems-forgot-static {
  color: #94a3b8;
}

.st-login-react-body--dark .ems-quick-links {
  color: #64748b;
}

.st-login-react-body--dark .ems-link-static {
  color: #7dd3fc;
}

.st-login-react-body--dark .ems-link-sep {
  color: #475569;
}

.st-login-react-body--dark .ems-copyright {
  color: #64748b;
}

.st-login-react-body--dark .ems-alert {
  background: rgba(127, 29, 29, 0.35);
  border-color: #991b1b;
  color: #fecaca;
}

/* ——— Skrini ya kupakia (React / mtindo wa portal kama ESS) ——— */
.st-boot {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
  font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, sans-serif;
  background: #ffffff;
  overflow: hidden;
  transition: opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1), transform 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.55s step-end;
}

.st-boot--exit {
  opacity: 0;
  transform: scale(0.98) translateY(6px);
  visibility: hidden;
  pointer-events: none;
}

.st-boot__aurora {
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 200deg at 50% 50%, rgba(56, 189, 248, 0.14), transparent 42%, rgba(23, 88, 131, 0.1), transparent 78%);
  animation: st-boot-aurora 14s linear infinite;
  pointer-events: none;
}

@keyframes st-boot-aurora {
  to {
    transform: rotate(360deg);
  }
}

.st-boot__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.55;
  pointer-events: none;
}

.st-boot__orb--1 {
  width: min(52vw, 22rem);
  height: min(52vw, 22rem);
  top: -8%;
  right: -12%;
  background: rgba(56, 189, 248, 0.35);
  animation: st-boot-float-a 9s ease-in-out infinite;
}

.st-boot__orb--2 {
  width: min(48vw, 18rem);
  height: min(48vw, 18rem);
  bottom: -10%;
  left: -8%;
  background: rgba(23, 88, 131, 0.22);
  animation: st-boot-float-b 11s ease-in-out infinite;
}

.st-boot__orb--3 {
  width: min(36vw, 12rem);
  height: min(36vw, 12rem);
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(14, 165, 233, 0.12);
  animation: st-boot-pulse 5s ease-in-out infinite;
}

@keyframes st-boot-float-a {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-12px, 18px);
  }
}

@keyframes st-boot-float-b {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(14px, -10px);
  }
}

@keyframes st-boot-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1.08);
  }
}

.st-boot__card {
  position: relative;
  width: 100%;
  max-width: 20.5rem;
  padding: 2rem 1.75rem 1.75rem;
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 7px rgba(15, 23, 42, 0.04), 0 22px 48px -12px rgba(23, 88, 131, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-align: center;
  animation: st-boot-card-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes st-boot-card-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.st-boot__spinner-wrap {
  position: relative;
  width: 7.5rem;
  height: 7.5rem;
  margin: 0 auto 1.35rem;
}

.st-boot__track {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #175883;
  border-right-color: rgba(23, 88, 131, 0.2);
  animation: st-boot-spin 1.2s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
}

.st-boot__track--delay {
  inset: 0.65rem;
  border-top-color: #0ea5e9;
  border-right-color: transparent;
  border-bottom-color: rgba(14, 165, 233, 0.35);
  animation-duration: 1.65s;
  animation-direction: reverse;
}

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

.st-boot__hub {
  position: absolute;
  inset: 1.35rem;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  box-shadow: 0 2px 12px rgba(23, 88, 131, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
}

.st-boot__logo {
  width: 3.35rem;
  height: 3.35rem;
  object-fit: contain;
  filter: drop-shadow(0 3px 10px rgba(23, 88, 131, 0.2));
  animation: st-boot-logo 2.8s ease-in-out infinite;
}

@keyframes st-boot-logo {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.st-boot__title {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: #0f172a;
}

.st-boot__slogan {
  margin: 0 0 1.1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #175883;
  line-height: 1.45;
}

.st-boot__bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(23, 88, 131, 0.1);
  overflow: hidden;
  margin-bottom: 1rem;
}

.st-boot__bar-fill {
  height: 100%;
  width: 38%;
  border-radius: inherit;
  background: linear-gradient(90deg, #175883, #38bdf8, #175883);
  background-size: 200% 100%;
  animation: st-boot-bar 1.85s ease-in-out infinite;
}

@keyframes st-boot-bar {
  0% {
    transform: translateX(-100%);
    background-position: 0% 50%;
  }
  100% {
    transform: translateX(280%);
    background-position: 100% 50%;
  }
}

.st-boot__loading {
  margin: 0 0 0.3rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.st-boot__dots {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
}

.st-boot__dots i {
  display: block;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: #175883;
  animation: st-boot-dot 0.95s ease-in-out infinite;
}

.st-boot__dots i:nth-child(2) {
  animation-delay: 0.14s;
}

.st-boot__dots i:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes st-boot-dot {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  40% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

.st-boot__portal {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.02em;
}

/* Hali ya giza */
.st-boot.st-boot--dark {
  background: linear-gradient(145deg, #0f172a 0%, #1e293b 50%, #0c1222 100%);
}

.st-boot.st-boot--dark .st-boot__card {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(148, 163, 184, 0.12);
  box-shadow: 0 4px 7px rgba(0, 0, 0, 0.2), 0 24px 56px -12px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.st-boot.st-boot--dark .st-boot__hub {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.st-boot.st-boot--dark .st-boot__title {
  color: #f1f5f9;
}

.st-boot.st-boot--dark .st-boot__slogan {
  color: #7dd3fc;
}

.st-boot.st-boot--dark .st-boot__loading {
  color: #cbd5e1;
}

.st-boot.st-boot--dark .st-boot__dots i {
  background: #38bdf8;
}

.st-boot.st-boot--dark .st-boot__portal {
  color: #94a3b8;
}

.st-boot.st-boot--dark .st-boot__track {
  border-top-color: #38bdf8;
  border-right-color: rgba(56, 189, 248, 0.2);
}

.st-boot.st-boot--dark .st-boot__track--delay {
  border-top-color: #7dd3fc;
  border-bottom-color: rgba(125, 211, 252, 0.35);
}

.st-boot.st-boot--dark .st-boot__bar {
  background: rgba(148, 163, 184, 0.15);
}

.st-boot.st-boot--dark .st-boot__bar-fill {
  background: linear-gradient(90deg, #0369a1, #38bdf8, #0369a1);
}
