/* =====================================================================
   Modal login ULBKP — jalur SSO UNJ + akun aplikasi
   Ditulis mandiri (tanpa build Tailwind) agar tampilannya konsisten
   di semua environment.
   ===================================================================== */

.lgn-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #007F73, #4CCD99);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 34px;
  border: 0;
  border-radius: 15px;
  cursor: pointer;
  box-shadow: 0 12px 24px -12px rgba(0, 127, 115, .8);
  transition: transform .18s ease, box-shadow .18s ease;
}

.lgn-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px -12px rgba(0, 127, 115, .85);
}

.lgn-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(6, 40, 36, .5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: lgnFade .22s ease both;
  overflow-y: auto;
}

@keyframes lgnFade { from { opacity: 0 } to { opacity: 1 } }

.lgn-card {
  position: relative;
  width: 100%;
  max-width: 900px;
  background: #fff;
  border-radius: 26px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  box-shadow: 0 40px 80px -30px rgba(0, 60, 54, .55);
  animation: lgnRise .34s cubic-bezier(.21, 1, .28, 1) both;
  max-height: calc(100vh - 40px);
}

@keyframes lgnRise {
  from { opacity: 0; transform: translateY(22px) scale(.985) }
  to   { opacity: 1; transform: translateY(0) scale(1) }
}

/* ---------- Panel kiri (branding) ---------- */
.lgn-aside {
  display: none;
  position: relative;
  padding: 38px 32px;
  background: linear-gradient(160deg, #00584f 0%, #007F73 45%, #4CCD99 130%);
  color: #eafaf3;
  overflow: hidden;
}

.lgn-aside::after {
  content: '';
  position: absolute;
  width: 320px; height: 320px;
  right: -120px; bottom: -140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}

.lgn-aside-logo {
  height: 52px;
  width: 52px;
  display: block;
  padding: 7px;
  box-sizing: border-box;
  object-fit: contain;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 20px -8px rgba(0, 20, 18, .5);
}

.lgn-aside h4 {
  margin: 24px 0 10px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;
}

.lgn-aside p {
  font-size: 13.5px;
  line-height: 1.7;
  color: rgba(234, 250, 243, .82);
}

.lgn-aside-art {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 260px;
  margin: 22px auto 0;
  display: block;
}

.lgn-aside-list {
  position: relative;
  z-index: 1;
  list-style: none;
  margin-top: 22px;
  display: grid;
  gap: 10px;
}

.lgn-aside-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(234, 250, 243, .9);
}

.lgn-aside-list svg { flex: 0 0 auto; margin-top: 2px }

/* ---------- Panel kanan (form) ---------- */
.lgn-main {
  position: relative; /* penopang overlay <x-loader /> */
  padding: 30px 28px 26px;
  overflow-y: auto;
}

.lgn-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.lgn-head-brand { display: flex; align-items: center; gap: 11px }
.lgn-head-brand img { height: 40px; width: auto }

.lgn-eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: #55AD9B;
}

.lgn-title {
  font-size: 20px;
  font-weight: 700;
  color: #00524a;
  line-height: 1.3;
  margin-top: 2px;
}

.lgn-close {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: #f1f5f4;
  color: #4a6a65;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.lgn-close:hover { background: #e3ebe9; color: #123531; transform: rotate(90deg) }

/* Tombol SSO */
.lgn-sso {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  text-decoration: none;
  padding: 15px 17px;
  border-radius: 17px;
  border: 1.5px solid rgba(0, 127, 115, .22);
  background: linear-gradient(135deg, rgba(0, 127, 115, .055), rgba(76, 205, 153, .1));
  color: #00524a;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.lgn-sso:hover {
  border-color: #4CCD99;
  transform: translateY(-2px);
  box-shadow: 0 16px 28px -16px rgba(0, 127, 115, .6);
}

.lgn-sso-icon {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 13px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px -6px rgba(0, 60, 54, .4);
}

.lgn-sso-text { flex: 1 1 auto; min-width: 0 }

.lgn-sso-text strong {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.35;
}

.lgn-sso-text span {
  display: block;
  font-size: 11.8px;
  line-height: 1.5;
  color: #5b7b76;
  margin-top: 2px;
}

.lgn-sso-arrow { flex: 0 0 auto; color: #55AD9B }

.lgn-recommend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #fff;
  background: #4CCD99;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 7px;
}

/* Pemisah */
.lgn-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 18px;
  color: #8aa6a1;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .02em;
}

.lgn-divider::before,
.lgn-divider::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(0, 127, 115, 0), rgba(0, 127, 115, .18), rgba(0, 127, 115, 0));
}

/* Field */
.lgn-field { margin-bottom: 15px }

.lgn-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #35544f;
  margin-bottom: 6px;
}

.lgn-input-wrap { position: relative; display: block }

.lgn-input-wrap > svg.lgn-lead {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ab4af;
  pointer-events: none;
}

.lgn-input {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: #123531;
  padding: 13px 44px 13px 42px;
  border: 1.5px solid #dfe9e7;
  border-radius: 14px;
  background: #fbfdfc;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.lgn-input::placeholder { color: #a9bdb9 }

.lgn-input:focus {
  border-color: #4CCD99;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(76, 205, 153, .16);
}

/* Sembunyikan ikon bawaan browser (reveal password Edge, ikon kredensial
   Chrome/Safari) agar tidak numpuk dengan ikon kustom (mata & label) */
.lgn-input::-ms-reveal,
.lgn-input::-ms-clear {
  display: none;
}

.lgn-input::-webkit-credentials-auto-fill-button,
.lgn-input::-webkit-strong-password-auto-fill-button {
  visibility: hidden;
  display: none !important;
  pointer-events: none;
  position: absolute;
  right: 0;
}

.lgn-input:-webkit-autofill,
.lgn-input:-webkit-autofill:hover,
.lgn-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #123531;
  -webkit-box-shadow: 0 0 0 1000px #fbfdfc inset;
  transition: background-color 9999s ease-in-out 0s;
}

.lgn-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #7f9c97;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lgn-toggle:hover { background: #eef5f3; color: #007F73 }

.lgn-error {
  display: block;
  font-size: 12px;
  color: #c62828;
  margin-top: 6px;
}

.lgn-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fdeceb;
  border: 1px solid #f6c9c6;
  color: #a52a2a;
  font-size: 12.8px;
  line-height: 1.55;
  padding: 12px 14px;
  border-radius: 13px;
  margin-bottom: 16px;
}

.lgn-alert svg { flex: 0 0 auto; margin-top: 1px }

.lgn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin-top: 4px;
  padding: 13px 20px;
  border: 0;
  border-radius: 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #007F73, #4CCD99);
  cursor: pointer;
  box-shadow: 0 14px 26px -14px rgba(0, 127, 115, .85);
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.lgn-submit:hover { transform: translateY(-2px) }
.lgn-submit:disabled { opacity: .65; cursor: progress; transform: none }

.lgn-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255, 255, 255, 0) 0deg, rgba(255, 255, 255, .75) 250deg, #fff 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.2px), #000 calc(100% - 2.2px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 2.2px), #000 calc(100% - 2.2px));
  animation: lgnSpin .8s linear infinite;
}

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

/* Overlay loading global (dipakai <x-loader />) */
.lgn-loader {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 253, 252, .82);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border-radius: inherit;
  animation: lgnFade .15s ease both;
}

/* Ring gradasi halus (comet-tail) — bukan dua-warna kaku */
.lgn-loader-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(0, 127, 115, 0) 0deg, #4CCD99 260deg, #007F73 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3.5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3.5px));
  animation: lgnSpin .85s linear infinite;
  filter: drop-shadow(0 2px 8px rgba(0, 127, 115, .28));
}

@media (prefers-reduced-motion: reduce) {
  .lgn-loader-spinner { animation-duration: 1.4s }
}

.lgn-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #eef3f2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: #5b7b76;
}

.lgn-link {
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: #007F73;
  cursor: pointer;
  text-decoration: none;
}

.lgn-link:hover { text-decoration: underline }

.lgn-hint {
  margin-top: 14px;
  font-size: 11.5px;
  line-height: 1.6;
  color: #7f9c97;
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (min-width: 820px) {
  .lgn-card { grid-template-columns: 0.85fr 1fr }
  .lgn-aside { display: block }
  .lgn-main { padding: 36px 34px 30px }
  .lgn-head-brand { display: none }
}

@media (max-width: 480px) {
  .lgn-card { border-radius: 20px }
  .lgn-main { padding: 24px 20px 22px }
  .lgn-title { font-size: 18px }
  .lgn-trigger { padding: 11px 26px }
}

@media (prefers-reduced-motion: reduce) {
  .lgn-overlay, .lgn-card, .lgn-sso, .lgn-submit, .lgn-trigger, .lgn-close {
    animation: none !important;
    transition: none !important;
  }
}

/* Pintasan SSO pada halaman utama */
.home-sso-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  padding: 9px 16px 9px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(0, 127, 115, .2);
  color: #00524a;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.home-sso-link:hover {
  transform: translateY(-2px);
  border-color: #4CCD99;
  box-shadow: 0 14px 26px -16px rgba(0, 127, 115, .7);
}

.home-sso-icon {
  width: 28px; height: 28px;
  border-radius: 9px;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px -4px rgba(0, 60, 54, .45);
}

@media (prefers-reduced-motion: reduce) {
  .home-sso-link { transition: none !important }
}
