/* SIMPUL-KIA — Halaman Login
 * Desktop: dua kolom (panel identitas | form). HP: panel identitas jadi header ringkas.
 */
.login-page {
  --lg-bg: #f4f8f6;
  --lg-card: #ffffff;
  --lg-text: #13261d;
  --lg-muted: #5f7468;
  --lg-border: #d9e6de;
  --lg-input-bg: #f8fbf9;
  --lg-input-focus: #0d9488;
  --lg-ring: rgba(13, 148, 136, 0.16);
  --lg-brand-a: #0b5e57;
  --lg-brand-b: #0d9488;
  --lg-brand-c: #3d7a5c;

  margin: 0;
  min-height: 100vh;
  background: var(--lg-bg);
  color: var(--lg-text);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
html[data-bs-theme="dark"] .login-page {
  --lg-bg: #0b120f;
  --lg-card: #131c18;
  --lg-text: #e6eeea;
  --lg-muted: #9fb0a7;
  --lg-border: #26342d;
  --lg-input-bg: #0f1713;
  --lg-input-focus: #2dd4bf;
  --lg-ring: rgba(45, 212, 191, 0.18);
  --lg-brand-a: #07322d;
  --lg-brand-b: #0a4a43;
  --lg-brand-c: #1b3b2c;
  background: var(--lg-bg) !important;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(380px, 46%) 1fr;
  min-height: 100vh;
}

/* ================= Panel identitas ================= */
.login-brand {
  position: relative;
  overflow: hidden;
  color: #ecfdf5;
  background: linear-gradient(150deg, var(--lg-brand-a) 0%, var(--lg-brand-b) 55%, var(--lg-brand-c) 100%);
  padding: 2.5rem 3rem;
  display: flex;
}
.brand-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

/* Gelembung cahaya yang melayang pelan */
.brand-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.55;
  animation: lgFloat 14s ease-in-out infinite;
  pointer-events: none;
}
.brand-blob--1 { width: 360px; height: 360px; top: -120px; right: -110px; background: radial-gradient(circle at 30% 30%, rgba(94, 234, 212, 0.55), transparent 65%); }
.brand-blob--2 { width: 300px; height: 300px; bottom: -90px; left: -80px; background: radial-gradient(circle at 50% 50%, rgba(244, 114, 182, 0.35), transparent 65%); animation-delay: -5s; }
.brand-blob--3 { width: 220px; height: 220px; top: 45%; right: 12%; background: radial-gradient(circle at 50% 50%, rgba(253, 224, 71, 0.22), transparent 65%); animation-delay: -9s; }

.brand-head { display: flex; align-items: center; gap: 0.9rem; }
.brand-logo {
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: 50%;
  background: #fff;
  padding: 4px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18), 0 0 0 4px rgba(255, 255, 255, 0.15);
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.brand-name { font-family: 'Outfit', sans-serif; font-size: 1.35rem; font-weight: 800; letter-spacing: 0.01em; line-height: 1.1; }
.brand-hospital { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; color: #99f6e4; margin-top: 3px; }

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.7rem, 2.6vw, 2.45rem);
  font-weight: 700;
  line-height: 1.18;
  margin: 0 0 0.8rem;
  color: #fff;
}
.brand-title span {
  background: linear-gradient(90deg, #99f6e4, #fde68a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-desc { color: rgba(236, 253, 245, 0.82); font-size: 0.95rem; line-height: 1.55; margin: 0; max-width: 440px; }

/* Garis detak jantung */
.brand-ecg { width: 100%; height: 64px; margin: 1.4rem 0 1.2rem; overflow: visible; }
.brand-ecg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ecg-track { stroke: rgba(255, 255, 255, 0.16); stroke-width: 2; }
.ecg-pulse {
  stroke: #5eead4;
  stroke-width: 3;
  stroke-dasharray: 140 1200;
  stroke-dashoffset: 140;
  filter: drop-shadow(0 0 6px rgba(94, 234, 212, 0.9));
  animation: lgEcg 3.2s linear infinite;
}

/* Daftar fitur */
.brand-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.85rem; }
.brand-features li {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  animation: lgSlideIn 600ms cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(300ms + var(--i) * 120ms);
  transition: transform 250ms, background 250ms;
}
.brand-features li:hover { transform: translateX(4px); background: rgba(255, 255, 255, 0.13); }
.feature-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  color: #ccfbf1;
  font-size: 1.15rem;
}
.brand-features strong { display: block; font-size: 0.92rem; font-weight: 700; color: #fff; }
.brand-features small { display: block; font-size: 0.78rem; color: rgba(236, 253, 245, 0.75); margin-top: 1px; }

.brand-foot { font-size: 0.78rem; color: rgba(236, 253, 245, 0.7); display: flex; align-items: center; gap: 0.5rem; }

/* ================= Panel form ================= */
.login-main {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem 1.5rem;
}
.login-theme-toggle { position: absolute; top: 1.1rem; right: 1.1rem; }

.login-card {
  width: 100%;
  max-width: 430px;
  animation: lgFadeUp 600ms cubic-bezier(.2, .8, .2, 1) both 100ms;
}
.login-heading { margin-bottom: 1.6rem; }
.login-eyebrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--lg-input-focus);
  background: var(--lg-ring);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}
.login-heading h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  margin: 0.8rem 0 0.4rem;
  color: var(--lg-text);
}
.login-heading p { color: var(--lg-muted); font-size: 0.92rem; line-height: 1.5; margin: 0; }

/* Pesan */
.login-alert {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.75rem 0.95rem;
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 500;
  margin-bottom: 1.1rem;
  border: 1px solid;
  animation: lgFadeUp 400ms ease both;
}
.login-alert i { font-size: 1rem; margin-top: 1px; }
.login-alert--error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; animation: lgShake 420ms ease both; }
.login-alert--success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.login-alert--warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.login-alert--info    { background: #f0f9ff; border-color: #bae6fd; color: #075985; }
html[data-bs-theme="dark"] .login-alert--error   { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.35); color: #fecaca; }
html[data-bs-theme="dark"] .login-alert--success { background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.35); color: #a7f3d0; }
html[data-bs-theme="dark"] .login-alert--warning { background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.35); color: #fde68a; }
html[data-bs-theme="dark"] .login-alert--info    { background: rgba(56, 189, 248, 0.1); border-color: rgba(56, 189, 248, 0.35); color: #bae6fd; }

/* Input */
.login-field { margin-bottom: 1.05rem; }
.login-field label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--lg-text) !important;
  margin-bottom: 0.4rem;
}
.login-input { position: relative; }
.login-input input {
  width: 100%;
  height: 50px;
  padding: 0 2.9rem 0 2.75rem;
  border-radius: 12px;
  border: 1.5px solid var(--lg-border);
  background: var(--lg-input-bg);
  color: var(--lg-text);
  font-size: 0.95rem;
  transition: border-color 180ms, box-shadow 180ms, background 180ms;
}
.login-input input::placeholder { color: #94a3a0 !important; }
.login-input input:hover { border-color: #b7cfc1; }
.login-input input:focus {
  outline: none;
  border-color: var(--lg-input-focus);
  background: var(--lg-card);
  box-shadow: 0 0 0 4px var(--lg-ring);
}
.login-input-icon {
  position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%);
  color: #7c968a; font-size: 1.05rem;
  transition: color 180ms;
  pointer-events: none;
}
.login-input:focus-within .login-input-icon { color: var(--lg-input-focus); }
.login-eye {
  position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px;
  border: none; border-radius: 10px;
  background: transparent;
  color: #7c968a;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 150ms, color 150ms;
}
.login-eye:hover { background: var(--lg-ring); color: var(--lg-input-focus); }
.login-eye:focus-visible { outline: 2px solid var(--lg-input-focus); }
.login-input.is-invalid input { border-color: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12); animation: lgShake 380ms ease; }
.login-input.is-invalid .login-input-icon { color: #ef4444; }
.login-capslock {
  margin-top: 0.4rem;
  font-size: 0.78rem; font-weight: 600;
  color: #b45309;
  display: flex; align-items: center; gap: 0.35rem;
}
html[data-bs-theme="dark"] .login-capslock { color: #fcd34d; }
html[data-bs-theme="dark"] .login-input input:hover { border-color: #36483f; }
html[data-bs-theme="dark"] .login-input input::placeholder { color: #61746b !important; }

/* Pemisah & bantuan */
.login-divider {
  display: flex; align-items: center; gap: 0.8rem;
  margin: 1.4rem 0 1.1rem;
  color: var(--lg-muted);
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
}
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--lg-border); }
.login-help {
  margin: 1.4rem 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--lg-muted);
}
.login-help i { margin-right: 0.25rem; }
.login-footer { margin-top: 2.2rem; font-size: 0.74rem; color: var(--lg-muted); text-align: center; }

/* ================= Responsif ================= */
@media (max-width: 991.98px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { padding: 1.4rem 1.25rem 2.6rem; }
  .brand-inner { gap: 0; }
  .brand-hero { margin-top: 1rem; }
  .brand-title { font-size: 1.35rem; margin-bottom: 0.3rem; }
  .brand-desc { font-size: 0.82rem; }
  .brand-ecg { height: 40px; margin: 0.8rem 0 0; }
  .brand-features, .brand-foot { display: none; }
  .login-main {
    margin-top: -1.6rem;
    border-radius: 24px 24px 0 0;
    background: var(--lg-bg);
    padding: 2rem 1.25rem 1.25rem;
    justify-content: flex-start;
  }
  .login-theme-toggle { position: fixed; top: 1rem; right: 1rem; z-index: 5; }
  .login-heading h2 { font-size: 1.5rem; }
}

/* ================= Animasi ================= */
@keyframes lgFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(18px, -22px) scale(1.06); }
  66%      { transform: translate(-14px, 14px) scale(0.96); }
}
@keyframes lgEcg {
  from { stroke-dashoffset: 140; }
  to   { stroke-dashoffset: -1200; }
}
@keyframes lgSlideIn {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes lgFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes lgShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  .brand-blob, .ecg-pulse, .brand-features li, .login-card, .login-alert, .login-input.is-invalid input { animation: none; }
  .ecg-pulse { stroke-dasharray: none; }
}

/* ================= Tag "Buatan SIMRS Tercanggih" ================= */
.brand-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding: 0.42rem 0.95rem 0.42rem 0.75rem;
  border-radius: 999px;
  overflow: hidden;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3b2a00;
  background: linear-gradient(90deg, #fde68a 0%, #fcd34d 45%, #99f6e4 100%);
  box-shadow: 0 6px 18px -4px rgba(253, 224, 71, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  animation: lgFadeUp 600ms cubic-bezier(.2, .8, .2, 1) both 150ms;
}
.brand-tag i {
  font-size: 0.95rem;
  color: #b45309;
  animation: lgTwinkle 2.4s ease-in-out infinite;
}
.brand-tag span { position: relative; z-index: 1; }
.brand-tag i { position: relative; z-index: 1; }
/* Kilau menyapu tag */
.brand-tag::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  transform: skewX(-20deg);
  animation: lgTagShine 4s ease-in-out infinite 1.5s;
}
@keyframes lgTwinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50%      { transform: scale(1.25) rotate(15deg); opacity: 0.8; }
}
@keyframes lgTagShine {
  0%   { left: -60%; }
  30%  { left: 130%; }
  100% { left: 130%; }
}
@media (max-width: 991.98px) {
  .brand-tag { font-size: 0.68rem; margin-bottom: 0.7rem; padding: 0.35rem 0.8rem 0.35rem 0.65rem; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-tag, .brand-tag i, .brand-tag::after { animation: none; }
}
