/* ==========================================================================
   Login - tampilan "aplikasi HP"
   Aktif hanya di layar < 1024px (di laptop/PC tampilan lama tidak berubah).
   ========================================================================== */

/* Elemen khusus HP disembunyikan di layar lebar */
.m-hero, .m-footer { display: none; }

@media (max-width: 1023.98px) {

  html { -webkit-text-size-adjust: 100%; }

  body.login-body {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
  }

  /* Dekorasi berat dimatikan di HP: lebih ringan & hemat baterai */
  body.login-body .particle,
  body.login-body > .blob,
  body.login-body > .animate-spin-slow,
  body.login-body > .animate-spin-slower { display: none !important; }

  /* Wadah utama: penuh layar, tanpa kotak kaca */
  .login-shell {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    max-width: none !important;
    min-height: 100vh;
    min-height: 100dvh;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    animation: none !important;
  }

  /* Tombol kembali: bulat, ikon saja */
  .back-home-btn {
    top: calc(env(safe-area-inset-top, 0px) + 12px) !important;
    left: 14px !important;
    width: 42px; height: 42px;
    padding: 0 !important;
    justify-content: center;
    border-radius: 50% !important;
  }
  .back-home-btn span { display: none; }
  .back-home-btn:hover { transform: none; }

  /* --- Bagian atas (hero) --- */
  .m-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #fff;
    padding: calc(env(safe-area-inset-top, 0px) + 56px) 24px 56px;
    position: relative;
    z-index: 1;
  }
  .m-hero .m-logo {
    position: relative;
    width: 84px; height: 84px;
    border-radius: 24px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.28);
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
  }
  .m-hero .m-logo img {
    width: 100%; height: 100%; object-fit: contain;
    border-radius: 24px; padding: 8px;
  }
  .m-hero .m-logo i { font-size: 2.2rem; color: #6ee7b7; }
  .m-hero .m-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    padding: 5px 12px; border-radius: 999px;
    background: rgba(16,185,129,.2); border: 1px solid rgba(16,185,129,.35);
    color: #d1fae5; margin-bottom: 10px;
  }
  .m-hero h1 {
    font-size: 1.35rem; line-height: 1.25; font-weight: 800;
    margin: 0; max-width: 20ch; text-wrap: balance;
  }
  .m-hero p { margin: 6px 0 0; font-size: .82rem; color: #cbd5e1; }

  /* --- Lembar form (bottom sheet) --- */
  .login-panel {
    flex: 1 1 auto;
    display: flex; flex-direction: column; justify-content: flex-start;
    background: #fff !important;
    border-radius: 28px 28px 0 0;
    margin-top: -28px;
    position: relative; z-index: 2;
    padding: 28px 22px calc(env(safe-area-inset-bottom, 0px) + 20px) !important;
    box-shadow: 0 -10px 40px rgba(2,6,23,.25);
    animation: sheetUp .45s cubic-bezier(.16,1,.3,1) both;
  }
  .login-panel::before {           /* "handle" kecil ala bottom sheet */
    content: ''; display: block;
    width: 40px; height: 4px; border-radius: 4px;
    background: #e2e8f0; margin: -12px auto 18px;
  }
  @keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

  .login-panel .login-title { font-size: 1.4rem !important; }
  .login-panel .login-head  { margin-bottom: 20px !important; }

  /* Input: tinggi nyaman disentuh, font 16px agar iOS tidak auto-zoom */
  .login-panel input[type="text"],
  .login-panel input[type="password"] {
    font-size: 16px !important;
    min-height: 54px;
    border-radius: 16px !important;
  }
  .login-panel .eye-btn {
    width: 52px; justify-content: center; padding: 0 !important;
    -webkit-tap-highlight-color: transparent;
  }
  .login-panel #btnSubmit {
    min-height: 56px;
    font-size: 1rem;
    border-radius: 16px !important;
    transform: none !important;
  }
  .login-panel #btnSubmit:active { transform: scale(.98) !important; }

  .login-panel .login-hint { margin-top: 20px !important; padding-top: 16px !important; }

  .m-footer {
    display: block; margin-top: auto; padding-top: 18px;
    text-align: center; font-size: .72rem; color: #94a3b8;
  }
}

/* Tablet / HP besar: sheet jadi kartu di tengah layar */
@media (min-width: 600px) and (max-width: 1023.98px) {
  body.login-body { align-items: center !important; justify-content: center !important; padding: 24px !important; }
  .login-shell {
    max-width: 460px !important; min-height: 0; border-radius: 28px !important;
    overflow: hidden; background: rgba(255,255,255,0.06) !important;
  }
  .login-panel { margin-top: -28px; border-radius: 28px 28px 0 0; }
}

/* HP posisi landscape / layar pendek: hero diringkas */
@media (max-width: 1023.98px) and (max-height: 520px) {
  .m-hero { padding-top: calc(env(safe-area-inset-top, 0px) + 20px); padding-bottom: 40px; flex-direction: row; gap: 14px; text-align: left; justify-content: center; }
  .m-hero .m-logo { width: 56px; height: 56px; margin: 0; border-radius: 16px; }
  .m-hero .m-badge, .m-hero p { display: none; }
  .back-home-btn { display: none !important; }
}
