body,
html {
  height: 100%;
}
body {
  margin: 0;
  font-family: 'Inter Variable', Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  color: #2F3031;
  background: #fff;
  font-size: 16px;
}

:root {
  --brand-blue: #1d4ed8;
  --brand-focus: #4c8df6;
  --poster-blue: #3779BC;
  --poster-border-blue: #69A1D9;
  --poster-dark-blue: #04297E;
  --step-blue: #1268c3;
  --step-circle: #0a2f6e;
  --gray-100: #f5f5f5;
  --gray-300: #d1d5db;
  --gray-500: #808489;
  --gray-600: #727272;
  --gray-800: #2f3031;
  --gray-900: #1e1f1f;
}

.kemd-login-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.kemd-login-container {
  display: flex;
  flex: 1;
  flex-direction: column;
  background: var(--poster-blue);
}
@media (min-width: 1024px) {
  .kemd-login-container {
    flex-direction: row;
  }
}

.kemd-poster-section {
  display: flex;
  flex-direction: column;
  order: 2;
}
@media (min-width: 1024px) {
  .kemd-poster-section {
    width: 62%;
    min-width: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    order: 1;
  }
}

.kemd-poster-content {
  padding: 1.25rem 1.5rem 1.5rem;
  background: var(--poster-blue) url('../img/pattern-background.webp') top center / cover no-repeat;
  color: #fff;
  flex: 1;
  display: flex;
  flex-direction: column;
  /* centred in the column; `safe` keeps the top reachable when the content
     is taller than the viewport instead of clipping it */
  justify-content: center;
  justify-content: safe center;
}
@media (min-width: 1024px) {
  .kemd-poster-content {
    padding: 1.5rem 2rem;
    flex: 1 1 auto;
    min-height: 0;
  }
}

/* Brand row: portal logo lockup */
.kemd-poster-brand-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
@media (min-width: 1024px) {
  .kemd-poster-brand-row {
    flex-direction: row;
    align-items: center;
    gap: 2rem;
    margin-bottom: 0.75rem;
  }
}

.kemd-poster-brand {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.kemd-poster-brand-logo {
  height: 62px;
  width: auto;
  object-fit: contain;
  display: block;
  object-position: left top;
}

.kemd-poster-subtitle {
  font-size: 0.8125rem;
  font-weight: 500;
  opacity: 0.85;
  margin: 0;
}

/* Cards — stacked: informasi penting on top, layanan bantuan below */
.kemd-poster-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 0 0 auto;
  align-items: stretch;
}

/* Base card — bubble-putih background */
.kemd-poster-card-item {
  background: url('../img/bubble-putih.webp') center / auto no-repeat;
  background-color: #fff;
  padding: 1rem;
  border-radius: 14px;
  color: #2F3031;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 0;
}

.kemd-poster-card-item p {
  font-size: 0.9125rem;
  line-height: 1.55;
  margin: 0.5rem 0 0;
  color: #0090d4;
}

.kemd-poster-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
  color: #0090d4;
  margin: 0;
}

/* Card 1 — Informasi Penting + tahapan konfigurasi ulang MFA */
.kemd-card-info {
  padding: 1rem 1.125rem 1.125rem;
}

.kemd-card-info-banner {
  width: auto;
  height: 2.2rem;
  display: block;
  border-radius: 8px;
}

.kemd-card-info-list {
  margin: 0.75rem 0 0;
  padding-left: 1.15rem;
  list-style: disc;
  text-align: justify;
  /* same blue as the Layanan Bantuan card body */
  color: #0090d4;
  font-size: 0.9125rem;
  line-height: 1.55;
}

.kemd-card-info-list li + li {
  margin-top: 0.4rem;
}

.kemd-card-info-list strong {
  color: var(--brand-blue);
  font-weight: 700;
}

/* MFA steps panel */
.kemd-mfa-panel {
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.875rem;
  padding: 0.75rem 0.875rem 0.875rem;
  border: 1px solid #d3e5f7;
  border-radius: 12px;
}

.kemd-mfa-title {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--step-blue);
  margin: 0 0 0.5rem;
}

.kemd-mfa-steps {
  display: flex;
  align-items: stretch;
  gap: 0.125rem;
  list-style: none;
  margin: 0;
  /* top padding clears the number circles, which would otherwise be
     clipped by the scroll container below */
  padding: 0.9rem 0 0.25rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #c3d9ec transparent;
}

/* Keep the scrollbar visible so it reads as an affordance when the row
   is wider than the panel. */
.kemd-mfa-steps::-webkit-scrollbar {
  height: 6px;
}

.kemd-mfa-steps::-webkit-scrollbar-track {
  background: transparent;
}

.kemd-mfa-steps::-webkit-scrollbar-thumb {
  background: #c3d9ec;
  border-radius: 3px;
}

.kemd-mfa-step {
  position: relative;
  /* grow to fill the row, but never below a legible width — the row
     scrolls instead of crushing the cards */
  flex: 1 0 84px;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1rem 0.4rem 0.65rem;
  background: #fff;
  border: 1px solid #e3e8ef;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  text-align: center;
  overflow-wrap: break-word;
}

/* Numbered circle — straddles the top edge of each step card */
.kemd-mfa-step-number {
  position: absolute;
  top: -0.72rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  background: var(--step-circle);
  border: 2px solid #fff;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

.kemd-mfa-step-img {
  width: 100%;
  max-width: 60px;
  height: 60px;
  object-fit: contain;
}

.kemd-mfa-step-title {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--step-blue);
  margin: 0;
}

.kemd-poster-card-item p.kemd-mfa-step-desc {
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--gray-800);
  margin: 0;
}

/* Chevron between step cards — aligned with the step icons */
.kemd-mfa-arrow {
  flex: 0 0 auto;
  align-self: flex-start;
  margin-top: 2.35rem;
  width: 0.55rem;
  color: var(--step-blue);
}

.kemd-mfa-arrow svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Card 2 — Layanan Bantuan */
.kemd-card-bantuan {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1.125rem;
}

.kemd-card-bantuan-icon {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.kemd-card-bantuan-icon img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.kemd-card-bantuan-body {
  flex: 1 1 240px;
  min-width: 0;
}

.kemd-card-bantuan-body p {
  margin-top: 0.25rem;
  font-size: 0.875rem;
}

.kemd-inline-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.kemd-inline-link:hover {
  opacity: 0.8;
}

.kemd-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
  white-space: nowrap;
  padding: 0.625rem 1rem;
  border-radius: 6px;
  background-color: var(--poster-dark-blue);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.kemd-card-cta:hover {
  opacity: 0.85;
}

.kemd-card-cta-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* Short desktop viewports (≈800px tall laptops) — tighten so the whole
   poster fits without scrolling the blue column. */
@media (min-width: 1024px) and (max-height: 860px) {
  .kemd-poster-content {
    padding: 1rem 2rem 1.125rem;
  }

  .kemd-poster-brand-logo {
    height: 52px;
  }

  .kemd-poster-cards {
    gap: 0.625rem;
  }

  .kemd-card-info-list {
    font-size: 0.85rem;
  }

  .kemd-mfa-title {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
  }

  .kemd-mfa-steps {
    padding-bottom: 0;
  }

  /* a touch narrower so 1280x800 clears the row without a scrollbar;
     they still grow to fill whatever width is actually there */
  .kemd-mfa-step {
    flex: 1 0 80px;
  }

  .kemd-mfa-step-img {
    max-width: 48px;
    height: 48px;
  }

  .kemd-mfa-arrow {
    margin-top: 2rem;
  }

  .kemd-mfa-step-title {
    font-size: 0.68rem;
  }

  .kemd-poster-card-item p.kemd-mfa-step-desc {
    font-size: 0.64rem;
  }

  .kemd-card-bantuan-body p {
    font-size: 0.8125rem;
  }
}

/* Large displays — the step row has spare width, so scale it up rather
   than leaving the cards sparse. */
@media (min-width: 1600px) {
  .kemd-mfa-step-img {
    max-width: 68px;
    height: 68px;
  }

  .kemd-mfa-step-title {
    font-size: 0.78rem;
  }

  .kemd-poster-card-item p.kemd-mfa-step-desc {
    font-size: 0.73rem;
  }

  .kemd-mfa-arrow {
    margin-top: 2.6rem;
  }
}

@media (max-width: 1023px) {
  .kemd-poster-brand-logo {
    height: 64px;
  }

  /* Justified text leaves rivers of whitespace at phone widths */
  .kemd-card-info-list {
    text-align: left;
  }

  .kemd-mfa-steps {
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }

  /* Roomier cards in the stacked layout: fill the width on wide tablets,
     scroll on phones. */
  .kemd-mfa-step {
    flex: 1 0 112px;
  }

  /* The row simply wraps at this width — switching to a column would make
     flex-basis apply to the vertical axis and stretch the text block. */
  .kemd-card-bantuan {
    justify-content: flex-start;
  }

  .kemd-card-cta {
    margin-left: 0;
  }
}

/* ─────────────────────────────────────────────────────────── */

/* Form Section */

.kemd-form-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  padding: 2rem;
  position: relative;
  background: #fff;
  order: 1;
}
@media (min-width: 1024px) {
  .kemd-form-section {
    width: 38%;
    min-width: 330px;
    padding: 2rem 2rem 1rem 2rem;
    order: 2;
  }
}

.kemd-page-title {
  font-weight: bold;
  font-size: 1.25rem;
  text-align: left !important;
  margin: 0.5rem 0 -1.5rem 0;
  display: block;
  width: 100%;
}

.kemd-form-inner {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2rem;
}
@media (min-width: 1024px) {
  .kemd-form-inner {
    max-width: 440px;
  }
}

.kemd-logo {
  height: 60px;
  width: 60px;
}

.kemd-title {
  font-size: 1.7rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 1rem;
  color: #000;
}
@media (min-width: 1024px) {
  .kemd-logo {
    font-size: 2rem;
  }
}

.kemd-sub {
  font-size: 1rem;
  line-height: 1.4;
}

input[type='text'],
input[type='password'],
input[type='email'] {
  font-family: inherit;
  font-size: 1rem;
  box-sizing: border-box;
  border: 1px solid var(--gray-500);
  border-radius: 0.25rem;
  padding: .75rem 1rem;
  width: 100%;
  height: 3rem;
}
input[type='text']:focus,
input[type='password']:focus,
input[type='email']:focus {
  outline: 2px solid var(--brand-focus);
  border-color: var(--brand-focus);
}

.kemd-button {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  background: var(--gray-800);
  border-radius: 0.25rem;
  cursor: pointer;
  transition: 0.15s background;
  height: 3rem;
  color: #fff;
  border: none;
}
.kemd-button:hover {
  background: var(--gray-900);
}
.kemd-button:focus {
  outline: 2px solid var(--brand-focus);
  outline-offset: 2px;
}

.kemd-tertiary-text {
  font-size: 0.875rem;
  color: var(--gray-500);
}
.kemd-link {
  color: #000;
  font-weight: 600;
  text-decoration: none;
}
.kemd-link:hover {
  text-decoration: underline;
}

.kemd-auth-app {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-600);
}

.kemd-legal {
  font-size: 0.875rem;
  line-height: 1.5;
  padding-bottom: 2rem;
}

#kc-form {
  width: 100%;
}
#kc-form-login {
  margin: 0;
}
#kc-form-buttons {
  margin-top: 1rem;
}

.kemd-hide {
  display: none !important;
}

#kc-header-wrapper, #kc-page-title {
  display: none;
}

header {
  display: none;
}

.kemd-password-wrapper {
  position: relative;
  width: 100%;
}
.kemd-password-wrapper input[type='password'],
.kemd-password-wrapper input[type='text'] {
  padding-right: 2.5rem;
  box-sizing: border-box;
}
.kemd-icon-button {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--gray-500);
  border-radius: 0.375rem;
}
.kemd-icon-button svg {
  width: 1rem;
  height: 1rem;
  display: block;
}
.kemd-icon-button:hover {
  color: #000;
  background: var(--gray-100);
}
.kemd-icon-button:focus {
  outline: 2px solid var(--brand-focus);
  outline-offset: 2px;
}
.kemd-icon-button[aria-pressed="true"] {
  color: var(--brand-blue);
  background: rgba(29, 78, 216, 0.08);
}

/* Alerts */

.alert-warning, .alert-error, .alert-success, .alert-info {
  position: fixed;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  z-index: 1000;
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.15), 0 2px 4px 0 rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1.4;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.alert-warning {
  background-color: rgba(254, 243, 205, 0.95);
  border: 1px solid #fecba1;
  color: #664d03;
}

.alert-error {
  background-color: rgba(254, 226, 226, 0.95);
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.alert-success {
  background-color: rgba(220, 252, 231, 0.95);
  border: 1px solid #86efac;
  color: #166534;
}

.alert-info {
  background-color: rgba(219, 234, 254, 0.95);
  border: 1px solid #93c5fd;
  color: #1e40af;
}

.alert-content {
  display: flex;
  align-items: center;
  flex: 1;
}

.alert-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  margin-left: 0.75rem;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s ease, background-color 0.2s ease;
  flex-shrink: 0;
}

.alert-close:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.1);
}

.alert-close:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  opacity: 1;
}

@media (min-width: 768px) {
  .alert-warning,
  .alert-error,
  .alert-success,
  .alert-info {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: auto;
    min-width: 300px;
    max-width: 500px;
  }
}

.alert-warning .alert-content::before {
  content: "⚠️";
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.alert-error .alert-content::before {
  content: "❌";
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.alert-success .alert-content::before {
  content: "✅";
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.alert-info .alert-content::before {
  content: "ℹ️";
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.alert-error, .alert-warning, .alert-success, .alert-info {
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 0.5rem 0.75rem !important;
  margin: 0.5rem 0 !important;
  font-size: 0.875rem;
}

.alert-error[data-closable],
.alert-warning[data-closable],
.alert-success[data-closable],
.alert-info[data-closable] {
  opacity: 1;
}

