/* Modern Login Page - Facebook Style with Pesantren Theme */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  background: linear-gradient(135deg, #02918a 0%, #045854 50%, #023a37 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Background Animation */
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.05;
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Login Container */
.login-container {
  display: flex;
  height: 70vh;
  max-width: 1200px;
  min-height: 600px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  position: relative;
  backdrop-filter: blur(10px);
}

/* Mobile-only elements (hidden on desktop) */
.mobile-login-trigger,
.mobile-sheet-handle,
.mobile-login-overlay {
  display: none;
}

/* Left Side - Branding */
.login-branding {
  flex: 1;
  background: linear-gradient(135deg, #02918a 0%, #045854 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 40px;
  color: white;
  position: relative;
  overflow: hidden;
}

.login-branding::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.1;
}

.brand-logo {
  width: 200px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
}

.brand-subtitle {
  font-size: 18px;
  opacity: 0.9;
  text-align: center;
  margin-bottom: 40px;
}

.brand-features {
  list-style: none;
  width: 100%;
}

.brand-features li {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}

.brand-features li:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(10px);
}

.brand-features svg {
  width: 24px;
  height: 24px;
  margin-right: 15px;
  flex-shrink: 0;
}

/* Right Side - Login Form */
.login-form-container {
  flex: 1;
  padding: 60px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-header {
  text-align: center;
  /* Jarak ke kolom input: 2rem — judul tidak lagi menempel ke form. */
  margin-bottom: 2rem;
}

.login-header h2 {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a1a;
  margin-top: 24px;   /* dinaikkan sedikit (dulu 40px) */
}

.login-header p {
  color: #65676b;
  font-size: 16px;
}

/* Form Styles */
.login-form {
  max-width: 400px;
  margin: 0 auto;
  width: 100%;
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #1a1a1a;
  font-size: 14px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e4e6eb;
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: #f0f2f5;
}

.form-input:focus {
  outline: none;
  border-color: #02918a;
  background: white;
  box-shadow: 0 0 0 4px rgba(2, 145, 138, 0.1);
}

.form-input.error {
  border-color: #fa383e;
  background: #fff5f5;
}

.input-icon {
  position: absolute;
  right: 15px;
  top: 42px;
  color: #65676b;
  cursor: pointer;
  transition: color 0.3s ease;
  margin-top: 15px;
}

.input-icon1 {
  position: absolute;
  right: 15px;
  top: 42px;
  color: #65676b;
  cursor: pointer;
  transition: color 0.3s ease;
  margin-top: 2px;
}

.input-icon:hover {
  color: #02918a;
}

/* Password Strength Indicator */
.password-strength {
  margin-top: 8px;
  height: 4px;
  border-radius: 2px;
  background: #e4e6eb;
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.strength-weak {
  background: #fa383e;
  width: 33%;
}
.strength-medium {
  background: #f79f31;
  width: 66%;
}
.strength-strong {
  background: #1ba854;
  width: 100%;
}

/* Remember Me & Forgot Password */
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.remember-me {
  display: flex;
  align-items: center;
}

.remember-me input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  cursor: pointer;
}

.remember-me label {
  color: #65676b;
  font-size: 14px;
  cursor: pointer;
}

.forgot-password {
  color: #02918a;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.3s ease;
}

.forgot-password:hover {
  color: #045854;
  text-decoration: underline;
}

/* Submit Button */
.login-button {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #02918a 0%, #045854 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(2, 145, 138, 0.3);
}

.login-button:active {
  transform: translateY(0);
}

.login-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.login-button .spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid #ffffff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

.login-button.loading .spinner {
  display: inline-block;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Divider */
.login-divider {
  display: flex;
  align-items: center;
  margin: 30px 0;
  color: #65676b;
  font-size: 14px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e4e6eb;
}

.login-divider span {
  padding: 0 20px;
}

/* Social Login */
.social-login {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
}

.social-button {
  flex: 1;
  padding: 12px;
  border: 2px solid #e4e6eb;
  background: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 600;
}

.social-button:hover {
  background: #f0f2f5;
  border-color: #02918a;
  transform: translateY(-2px);
}

.social-button svg {
  width: 20px;
  height: 20px;
  margin-right: 8px;
}

/* Sign Up Link */
.signup-link {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e4e6eb;
  color: #65676b;
  font-size: 14px;
}

.signup-link a {
  color: #02918a;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.signup-link a:hover {
  color: #045854;
  text-decoration: underline;
}

/* Error Messages */
.error-message {
  background: #fff5f5;
  border: 1px solid #fa383e;
  color: #fa383e;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  display: none;
}

.error-message.show {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Success Messages */
.success-message {
  background: #f0fdf4;
  border: 1px solid #1ba854;
  color: #1ba854;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  display: none;
}

.success-message.show {
  display: block;
  animation: slideDown 0.3s ease;
}

/* Two Factor Authentication */
.\32 fa-container {
  display: none;
  text-align: center;
}

.\32 fa-container.show {
  display: block;
}

.\32 fa-title {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 10px;
}

.\32 fa-subtitle {
  color: #65676b;
  margin-bottom: 30px;
}

.\32 fa-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 30px;
}

.\32 fa-input {
  width: 50px;
  height: 50px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  border: 2px solid #e4e6eb;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.\32 fa-input:focus {
  outline: none;
  border-color: #02918a;
  box-shadow: 0 0 0 4px rgba(2, 145, 138, 0.1);
}

/* Login Type Selector */
.login-type-selector {
  margin-bottom: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(2, 145, 138, 0.1);
}

.login-type-label {
  font-size: 14px;
  font-weight: 600;
  color: #045854;
  margin-bottom: 15px;
  text-align: center;
}

.login-type-options {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.login-type-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 2px solid rgba(2, 145, 138, 0.2);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  flex: 1;
  max-width: 150px;
  justify-content: center;
}

.login-type-btn:hover {
  border-color: #02918a;
  background: rgba(2, 145, 138, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 145, 138, 0.15);
}

.login-type-btn.active {
  border-color: #02918a;
  background: #02918a;
  color: white;
  box-shadow: 0 4px 12px rgba(2, 145, 138, 0.3);
}

.login-type-btn svg {
  flex-shrink: 0;
}

/* Form Wrapper */
.login-form-wrapper {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Registration Form Styles */
.registration-header {
  text-align: center;
  margin-bottom: 25px;
}

.registration-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: #045854;
  margin-bottom: 8px;
}

.registration-header p {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

.form-row {
  display: flex;
  gap: 15px;
}

.form-row .form-group {
  flex: 1;
}

.form-actions {
  display: flex;
  gap: 15px;
  margin-top: 25px;
}

.secondary-btn {
  flex: 1;
  padding: 12px 20px;
  border: 2px solid rgba(2, 145, 138, 0.2);
  background: white;
  color: #02918a;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.secondary-btn:hover {
  border-color: #02918a;
  background: rgba(2, 145, 138, 0.05);
}

/* Enhanced Form Styles */
.login-form-wrapper .form-group {
  margin-bottom: 20px;
}

.login-form-wrapper .form-label {
  font-size: 14px;
  font-weight: 500;
  color: #045854;
  margin-bottom: 8px;
  display: block;
}

.login-form-wrapper .form-input {
  width: 100%;
  border: 2px solid rgba(2, 145, 138, 0.1);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  background: white;
}

.login-form-wrapper .form-input:focus {
  outline: none;
  border-color: #02918a;
  box-shadow: 0 0 0 3px rgba(2, 145, 138, 0.1);
}

.login-form-wrapper .form-input::placeholder {
  color: #999;
}

.login-form-wrapper select.form-input {
  padding: 12px 15px;
  cursor: pointer;
}

.login-form-wrapper .input-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  cursor: pointer;
  transition: color 0.3s ease;
}

.login-form-wrapper .input-icon:hover {
  color: #02918a;
}

.login-form-wrapper .toggle-password {
  cursor: pointer;
}

.login-form-wrapper .form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.login-form-wrapper .remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #666;
}

.login-form-wrapper .remember-me input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #02918a;
}

.login-form-wrapper .forgot-password {
  font-size: 14px;
  color: #02918a;
  text-decoration: none;
  transition: color 0.3s ease;
}

.login-form-wrapper .forgot-password:hover {
  color: #045854;
  text-decoration: underline;
}

.login-form-wrapper .login-btn {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #02918a, #045854);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.login-form-wrapper .login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(2, 145, 138, 0.3);
}

.login-form-wrapper .login-btn:active {
  transform: translateY(0);
}

.login-form-wrapper .btn-loader {
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .login-container {
    flex-direction: column;
    max-width: 100%;
    margin: 20px;
  }

  .login-branding {
    padding: 40px 30px;
    min-width: auto;
  }

  .login-form-container {
    padding: 30px 25px;
  }

  .brand-title {
    font-size: 28px;
  }

  .brand-subtitle {
    font-size: 14px;
  }

  .brand-features {
    gap: 15px;
  }

  .brand-features li {
    font-size: 13px;
  }

  .login-type-options {
    flex-direction: column;
    gap: 10px;
  }

  .login-type-btn {
    max-width: none;
  }

  .form-row {
    flex-direction: column;
    gap: 15px;
  }

  .form-actions {
    flex-direction: column;
  }

  .secondary-btn {
    order: 2;
  }
}

@media (max-width: 480px) {
  .login-container {
    margin: 10px;
    border-radius: 15px;
  }

  .login-form-container {
    padding: 30px 20px;
  }

  .social-login {
    flex-direction: column;
  }

  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
}

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.loading-overlay.show {
  display: flex;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e4e6eb;
  border-top: 4px solid #02918a;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Security Badge */
.security-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 12px;
  border-radius: 20px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 5px;
}

.security-badge svg {
  width: 14px;
  height: 14px;
}

.security-tips h4 {
  text-align: left;
  margin-bottom: 10px;
  margin-right: 10px;
}

.security-tips li {
  text-align: left;
  color: #505050;
  font-size: 14px;
  margin-top: 2px;
  list-style-type: none;
}

/* =========================================================
   MOBILE: branding fullscreen + slide-up login bottom sheet
   (only affects phones; desktop layout unchanged)
   ========================================================= */
@media (max-width: 768px) {
  html,
  body {
    height: 100vh;   /* fallback browser lama */
    height: 100dvh;  /* dynamic viewport: hormati bilah alamat browser HP
                        agar konten tidak "terdorong ke bawah" saat belum di-install */
    overflow: hidden;
  }

  body {
    padding: 0;
    min-height: 0;   /* batalkan min-height:100vh dasar → hilangkan celah di atas
                        (100vh > 100dvh saat bilah alamat browser tampil) */
  }

  .login-container {
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: 100%;
    min-height: 0;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    position: relative;
  }

  /* Branding memenuhi layar. Konten (logo, judul, subjudul, fitur) DIPUSATKAN
     di tengah layar lewat dua margin-top:auto (di .brand-logo & tombol Masuk)
     yang membagi rata ruang kosong — tombol Masuk tetap terpaku di dasar. */
  .login-branding {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    /* atas: napas dari header/notch · bawah: napas tombol dari gesture bar */
    padding: calc(40px + env(safe-area-inset-top, 0px)) 26px
             calc(24px + env(safe-area-inset-bottom, 0px));
    justify-content: flex-start;
    gap: 2px;
    overflow: hidden;
  }

  .security-badge {
    top: calc(14px + env(safe-area-inset-top, 0px));
    right: 16px;
  }

  .brand-logo {
    width: 130px;
    height: 108px;
    margin-top: auto;      /* pasangan margin-top:auto tombol → konten center vertikal */
    margin-bottom: 6px;
  }

  .brand-title {
    font-size: 26px;
    margin-bottom: 6px;
  }

  .brand-subtitle {
    font-size: 13px;
    margin-bottom: 22px;
  }

  .brand-features li {
    margin-bottom: 12px;
    padding: 11px 13px;
    font-size: 13px;
    border-radius: 10px;
  }

  .brand-features svg {
    width: 20px;
    height: 20px;
    margin-right: 12px;
  }

  /* "Masuk" trigger pinned at the very bottom */
  .mobile-login-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: auto;          /* dorong tombol ke DASAR branding, tepat di atas gesture bar */
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 14px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(6px);
    z-index: 5;
  }

  .mobile-login-trigger svg {
    animation: bounceHint 1.8s ease-in-out infinite;
  }

  @keyframes bounceHint {
    0%,
    100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-4px);
    }
  }

  /* Dim overlay behind the sheet */
  .mobile-login-overlay {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    z-index: 40;
  }

  .mobile-login-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* Login form becomes a slide-up bottom sheet */
  .login-form-container {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    max-height: 90vh;
    max-height: 90dvh;
    padding: 14px 22px calc(28px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-radius: 26px 26px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.28);
    transform: translateY(105%);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 50;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .login-container.mobile-login-open .login-form-container {
    transform: translateY(0);
  }

  /* Drag handle at top of the sheet */
  .mobile-sheet-handle {
    display: block;
    width: 44px;
    height: 5px;
    border-radius: 3px;
    background: #d0d4da;
    margin: 0 auto 14px;
    cursor: pointer;
    flex-shrink: 0;
  }

  .login-header {
    /* Jarak ke kolom input: 2rem (ruang tersedia setelah selector "Masuk sebagai" dihapus). */
    margin-bottom: 2rem;
  }

  .login-header h2 {
    font-size: 21px;
    margin-top: 4px;      /* dinaikkan sedikit; dulu 50px → boros ruang */
    margin-bottom: 4px;
  }

  .login-header p {
    font-size: 13px;
  }

  .login-type-selector {
    margin-bottom: 14px;
    padding: 12px;
  }

  .login-type-label {
    margin-bottom: 10px;
  }

  /* Tombol role SEJAJAR horizontal: grid 3 kolom sama lebar. Ikon di atas teks
     agar muat rapi di kolom sempit HP. (Menimpa flex-direction:column dari blok
     @media 768px lama yang membuatnya menumpuk vertikal.) */
  .login-type-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .login-type-btn {
    flex-direction: column;
    gap: 5px;
    padding: 10px 4px;
    font-size: 12px;
    max-width: none;
    text-align: center;
    line-height: 1.15;
  }

  .signup-link {
    margin-top: 14px;
    padding-top: 12px;
  }

  /* Rapatkan jarak antar field di HP agar seluruh konten muat & tidak renggang. */
  .login-form-wrapper .form-group {
    margin-bottom: 13px;
  }

  /* Keep "remember me" (left) and "forgot password" (right) on one row */
  .form-options,
  .login-form-wrapper .form-options {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: nowrap;
    margin-bottom: 16px;
  }

  .form-options .remember-me {
    flex-shrink: 0;
  }

  .form-options .forgot-password {
    text-align: right;
    flex-shrink: 0;
  }
}

/* ==========================================================================
   DESKTOP POLISH (>= 769px)
   --------------------------------------------------------------------------
   Di-scope khusus desktop agar tampilan MOBILE (branding full-screen +
   bottom-sheet di blok <=768px) TIDAK terpengaruh sama sekali.

   Memperbaiki:
   1) .login-container tanpa `width` -> lebar mengikuti konten (tampak sempit).
   2) height:70vh + min-height:600px + overflow:hidden -> kartu melar di layar
      tinggi, dan konten TERPOTONG di laptop pendek (tak bisa di-scroll).
   3) body overflow:hidden -> konten terpotong tidak bisa dijangkau.
   4) Kolom form terlalu lebar -> field login melebar, kurang fokus.
   ========================================================================== */
@media (min-width: 769px) {
  body {
    /* Ruang tepi + izinkan menggulir bila layar pendek (anti konten terpotong). */
    padding: 40px 28px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .login-container {
    width: 100%;          /* sebelumnya tidak ada -> penyebab utama tak rapi */
    max-width: 1080px;
    height: auto;         /* sebelumnya 70vh -> melar di layar tinggi */
    min-height: 560px;    /* tetap berwibawa, tapi tidak memaksa/memotong */
    margin: auto;
  }

  /* Proporsi kolom: branding sedikit dominan, form tetap lega. */
  .login-branding {
    flex: 1.05;
    padding: 56px 46px;
  }

  .login-form-container {
    flex: 1;
    padding: 56px 52px;
  }

  /* Form tidak ikut melebar di monitor besar -> tetap fokus & mudah dibaca. */
  .login-form-container > * {
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Layar sangat lebar: jaga kartu tetap proporsional (tidak menganga). */
@media (min-width: 1500px) {
  .login-container {
    max-width: 1140px;
  }
}

/* ==========================================================================
   MODE APLIKASI TERPASANG (standalone / PWA) — TAMPILAN BROWSER TAK TERSENTUH.
   Faktor: di Android PWA, Chrome TIDAK melaporkan env(safe-area-inset-bottom)
   untuk gesture/navigation bar (hanya notch atas). Akibatnya di aplikasi
   padding bawah = 24px saja → tombol "Masuk" tenggelam di balik bilah sistem
   → terlihat "terlalu ke bawah". Di sini kita paksa jarak dasar minimum agar
   tombol terangkat & aman. max() memakai safe-area bila memang terlapor (iOS).
   ========================================================================== */
@media (display-mode: standalone) and (max-width: 768px) {
  .login-branding {
    /* Android tak melapor safe-area untuk gesture bar → cadangkan ~52px untuk
       bilah sistem, LALU + 1rem (16px) sebagai jarak tampak tombol ke bawah.
       Bila gesture bar HP lebih tinggi/pendek, cukup ubah angka 52px ini. */
    padding-bottom: max(calc(52px + 1rem), calc(1rem + env(safe-area-inset-bottom, 0px)));
  }

  /* Sheet form login: beri jarak dasar cukup agar baris terakhir
     ("Belum punya akun? Hubungi Administrator") TIDAK tertutup gesture bar. */
  .login-form-container {
    padding-bottom: max(calc(52px + 1rem), calc(28px + env(safe-area-inset-bottom, 0px)));
  }
}
