/* ==========================================================================
   SIMPEGSUDIN — Halaman Login Dark Glassmorphism (Terisolasi dari portal.css)
   Portal Kepegawaian Suku Dinas Kesehatan Jakarta Timur
   Inspirasi: Linear.app & Stripe | Ambient Aurora Glow + Grid + Frosted Glass
   Zero-CDN | Font Lokal Plus Jakarta Sans | WCAG 2.2 AA | Responsif Penuh
   ========================================================================== */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --lg-bg: #0f172a;
  --lg-bg-deep: #090e1a;
  --lg-card-bg: rgba(15, 23, 42, 0.62);
  --lg-card-border: rgba(51, 65, 85, 0.78);
  --lg-card-highlight: rgba(255, 255, 255, 0.08);

  --lg-input-bg: rgba(2, 6, 23, 0.54);
  --lg-input-bg-hover: rgba(2, 6, 23, 0.68);
  --lg-input-bg-focus: rgba(2, 6, 23, 0.78);
  --lg-input-border: rgba(71, 85, 105, 0.62);
  --lg-input-border-hover: rgba(100, 116, 139, 0.85);

  --lg-text: #f8fafc;
  --lg-text-secondary: #94a3b8;
  --lg-text-muted: #64748b;

  --lg-emerald: #10b981;
  --lg-emerald-bright: #34d399;
  --lg-teal: #14b8a6;
  --lg-teal-deep: #0d9488;
  --lg-blue-glow: #1d4ed8;

  --lg-amber-bg: rgba(245, 158, 11, 0.11);
  --lg-amber-border: rgba(245, 158, 11, 0.34);
  --lg-amber-text: #fde68a;
  --lg-amber-icon: #fbbf24;

  --lg-success-bg: rgba(16, 185, 129, 0.11);
  --lg-success-border: rgba(16, 185, 129, 0.32);
  --lg-success-text: #a7f3d0;
  --lg-success-icon: #34d399;

  --lg-error-bg: rgba(239, 68, 68, 0.12);
  --lg-error-border: rgba(248, 113, 113, 0.36);
  --lg-error-text: #fecaca;
  --lg-error-icon: #f87171;

  --lg-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --lg-font: "Plus Jakarta Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}

body.login-body {
  margin: 0;
  min-height: 100%;
  font-family: var(--lg-font);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--lg-text);
  background-color: var(--lg-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* Skip link aksesibilitas keyboard */
.login-skip-link {
  position: absolute;
  left: -9999px;
  top: 14px;
  background: var(--lg-emerald);
  color: #022c22;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  z-index: 100;
}

.login-skip-link:focus {
  left: 16px;
  outline: none;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.35);
}

/* ==========================================================================
   Latar Belakang: Ambient Aurora Mesh Glow + Subtle Grid Pattern Tipis
   ========================================================================== */
.login-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(circle at 50% 0%, rgba(15, 23, 42, 0.2) 0%, var(--lg-bg-deep) 100%);
}

/* Grid tipis ala Linear/Vercel dengan radial mask agar memudar halus */
.login-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.065) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.065) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 72% 68% at 50% 45%, #000 35%, transparent 100%);
  mask-image: radial-gradient(ellipse 72% 68% at 50% 45%, #000 35%, transparent 100%);
}

/* Ambient Aurora Mesh Orbs di Sudut */
.login-aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(96px);
  will-change: transform;
}

.login-aurora--tl {
  width: 560px;
  height: 560px;
  top: -190px;
  left: -140px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.34) 0%, rgba(20, 184, 166, 0.16) 48%, transparent 72%);
}

.login-aurora--br {
  width: 620px;
  height: 620px;
  bottom: -220px;
  right: -150px;
  background: radial-gradient(circle, rgba(29, 78, 216, 0.38) 0%, rgba(14, 165, 233, 0.16) 48%, transparent 74%);
}

.login-aurora--tr {
  width: 400px;
  height: 400px;
  top: -110px;
  right: 8%;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.18) 0%, rgba(30, 64, 175, 0.12) 55%, transparent 75%);
}

/* ==========================================================================
   Wadah Pusat Layar
   ========================================================================== */
.login-stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
}

/* ==========================================================================
   Floating Frosted Glass Card (backdrop-blur-md, bg-slate-900/60, border-slate-800)
   ========================================================================== */
.login-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--lg-card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--lg-card-border);
  border-radius: 22px;
  padding: 36px 34px 28px;
  box-shadow:
    0 28px 64px -22px rgba(2, 6, 23, 0.85),
    0 0 0 1px rgba(15, 23, 42, 0.6),
    inset 0 1px 0 var(--lg-card-highlight);
}

/* Garis aksen cahaya tipis di tepi atas kartu (Linear signature detail) */
.login-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(52, 211, 153, 0.55) 35%,
    rgba(56, 189, 248, 0.55) 65%,
    transparent 100%
  );
  pointer-events: none;
}

/* Header Card */
.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-emblem {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.18) 0%, rgba(14, 116, 144, 0.24) 100%);
  border: 1px solid rgba(52, 211, 153, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lg-emerald-bright);
  box-shadow:
    0 10px 26px -8px rgba(16, 185, 129, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.login-emblem svg {
  width: 26px;
  height: 26px;
}

.login-brand-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  background: linear-gradient(125deg, #ffffff 15%, #a7f3d0 58%, #5eead4 85%, #38bdf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-brand-sub {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: #cbd5e1;
  line-height: 1.4;
}

.login-agency-name {
  margin: 4px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--lg-text-secondary);
  letter-spacing: 0.01em;
}

/* ==========================================================================
   Alert Banner Modern (Sesi Berakhir Amber Redup, Logout Emerald, Error Rose)
   ========================================================================== */
.login-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 18px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 13px;
  line-height: 1.45;
}

.login-notice-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin-top: 1px;
}

.login-notice strong {
  font-weight: 700;
}

.login-notice--expired {
  background: var(--lg-amber-bg);
  border-color: var(--lg-amber-border);
  color: var(--lg-amber-text);
}

.login-notice--expired .login-notice-icon {
  color: var(--lg-amber-icon);
}

.login-notice--logout {
  background: var(--lg-success-bg);
  border-color: var(--lg-success-border);
  color: var(--lg-success-text);
}

.login-notice--logout .login-notice-icon {
  color: var(--lg-success-icon);
}

.login-notice--error {
  background: var(--lg-error-bg);
  border-color: var(--lg-error-border);
  color: var(--lg-error-text);
}

.login-notice--error .login-notice-icon {
  color: var(--lg-error-icon);
}

/* ==========================================================================
   Form Inputs (Dark Transparent + Emerald Glow Focus + Lucide Icons)
   ========================================================================== */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.login-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  letter-spacing: 0.005em;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: #64748b;
  pointer-events: none;
  transition: color 0.22s var(--lg-ease);
}

.login-input-wrap:focus-within .login-input-icon {
  color: var(--lg-emerald-bright);
}

.login-input {
  width: 100%;
  height: 46px;
  padding: 10px 14px 10px 42px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--lg-text);
  background-color: var(--lg-input-bg);
  border: 1px solid var(--lg-input-border);
  border-radius: 12px;
  transition:
    background-color 0.22s var(--lg-ease),
    border-color 0.22s var(--lg-ease),
    box-shadow 0.22s var(--lg-ease);
  appearance: none;
}

.login-input::placeholder {
  color: #475569;
}

.login-input--password {
  padding-right: 46px;
}

.login-input:hover {
  background-color: var(--lg-input-bg-hover);
  border-color: var(--lg-input-border-hover);
}

.login-input:focus {
  outline: none;
  background-color: var(--lg-input-bg-focus);
  border-color: var(--lg-emerald);
  box-shadow:
    0 0 0 3.5px rgba(16, 185, 129, 0.20),
    0 0 22px -4px rgba(16, 185, 129, 0.34);
}

.login-input.is-invalid {
  border-color: rgba(248, 113, 113, 0.78);
}

.login-input.is-invalid:focus {
  border-color: #f87171;
  box-shadow:
    0 0 0 3.5px rgba(248, 113, 113, 0.20),
    0 0 18px -4px rgba(239, 68, 68, 0.35);
}

/* Dark-mode Autofill agar browser tidak menimpa latar input jadi putih silau */
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f8fafc;
  -webkit-box-shadow: 0 0 0 1000px #0b1324 inset;
  box-shadow: 0 0 0 1000px #0b1324 inset;
  border-color: rgba(16, 185, 129, 0.55);
  caret-color: #f8fafc;
  transition: background-color 5000s ease-in-out 0s;
}

/* Tombol Show/Hide Password */
.login-pwd-toggle {
  position: absolute;
  right: 7px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.18s var(--lg-ease), color 0.18s var(--lg-ease);
}

.login-pwd-toggle:hover {
  background-color: rgba(148, 163, 184, 0.12);
  color: #e2e8f0;
}

.login-pwd-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.30);
  color: var(--lg-emerald-bright);
}

.login-pwd-toggle svg {
  width: 17px;
  height: 17px;
}

.login-pwd-toggle .icon-eye-off {
  display: none;
}

.login-pwd-toggle.is-visible .icon-eye {
  display: none;
}

.login-pwd-toggle.is-visible .icon-eye-off {
  display: block;
  color: var(--lg-emerald-bright);
}

.login-field-error {
  margin: 1px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--lg-error-text);
}

.login-field-error-tag {
  font-weight: 700;
  color: var(--lg-error-icon);
}

/* ==========================================================================
   Tombol Login: Emerald -> Teal Gradient + Smooth Hover + Loading State
   ========================================================================== */
.login-submit {
  margin-top: 6px;
  width: 100%;
  height: 48px;
  padding: 0 20px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 12px;
  background: linear-gradient(135deg, #10b981 0%, #0d9488 58%, #0f766e 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow:
    0 12px 28px -10px rgba(16, 185, 129, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transition:
    transform 0.2s var(--lg-ease),
    box-shadow 0.22s var(--lg-ease),
    filter 0.2s var(--lg-ease),
    opacity 0.2s var(--lg-ease);
}

.login-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.07);
  box-shadow:
    0 16px 34px -8px rgba(16, 185, 129, 0.62),
    0 0 24px -6px rgba(20, 184, 166, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.login-submit:active:not(:disabled) {
  transform: translateY(0);
  filter: brightness(0.96);
}

.login-submit:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px var(--lg-bg),
    0 0 0 5.5px var(--lg-emerald-bright);
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.88;
}

.login-submit-arrow {
  width: 17px;
  height: 17px;
  transition: transform 0.2s var(--lg-ease);
}

.login-submit:hover:not(:disabled) .login-submit-arrow {
  transform: translateX(3px);
}

.login-submit-default {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.login-submit-loading {
  display: none;
  align-items: center;
  gap: 8px;
}

.login-submit.is-loading .login-submit-default {
  display: none;
}

.login-submit.is-loading .login-submit-loading {
  display: inline-flex;
}

.login-spinner {
  width: 17px;
  height: 17px;
  animation: login-spin 0.85s linear infinite;
}

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

/* ==========================================================================
   Footer Card: Security Badge + Copyright
   ========================================================================== */
.login-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(51, 65, 85, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.login-sec-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.09);
  border: 1px solid rgba(16, 185, 129, 0.24);
  color: #a7f3d0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.015em;
}

.login-sec-badge svg {
  width: 13.5px;
  height: 13.5px;
  color: var(--lg-emerald-bright);
  flex-shrink: 0;
}

.login-copyright {
  margin: 0;
  font-size: 11.5px;
  color: var(--lg-text-muted);
  line-height: 1.45;
}

/* ==========================================================================
   Penyesuaian Tinggi Terbatas (Laptop 1366x768)
   ========================================================================== */
@media (max-height: 780px) and (min-width: 640px) {
  .login-stage {
    padding: 18px 20px;
  }

  .login-card {
    padding: 28px 32px 24px;
  }

  .login-header {
    margin-bottom: 18px;
  }

  .login-emblem {
    width: 46px;
    height: 46px;
    margin-bottom: 10px;
  }

  .login-brand-title {
    font-size: 25px;
  }

  .login-notice {
    margin-bottom: 14px;
    padding: 9px 12px;
  }

  .login-form {
    gap: 14px;
  }

  .login-input {
    height: 44px;
  }

  .login-submit {
    height: 46px;
  }

  .login-footer {
    margin-top: 18px;
    padding-top: 14px;
    gap: 8px;
  }
}

/* ==========================================================================
   Responsif Ponsel (<= 480px — Diuji Ketat pada 360x800)
   ========================================================================== */
@media (max-width: 480px) {
  .login-stage {
    padding: 20px 16px;
    justify-content: center;
  }

  .login-card {
    padding: 28px 20px 24px;
    border-radius: 20px;
  }

  .login-header {
    margin-bottom: 20px;
  }

  .login-emblem {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
  }

  .login-brand-title {
    font-size: 24px;
  }

  .login-brand-sub {
    font-size: 13px;
  }

  .login-agency-name {
    font-size: 12px;
  }

  .login-notice {
    margin-bottom: 14px;
    padding: 10px 12px;
    font-size: 12.5px;
  }

  .login-form {
    gap: 14px;
  }

  /* Mencegah auto-zoom iOS Safari pada input < 16px */
  .login-input {
    font-size: 16px;
    height: 46px;
  }

  .login-submit {
    height: 48px;
  }

  .login-footer {
    margin-top: 20px;
    padding-top: 16px;
  }

  .login-aurora--tl {
    width: 340px;
    height: 340px;
    top: -120px;
    left: -120px;
  }

  .login-aurora--br {
    width: 360px;
    height: 360px;
    bottom: -140px;
    right: -130px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
