/* Galaxy Command Station shell for first-time Google Authenticator enrollment (v25). */
body[data-page-id="login-login-config-totp"],
body:has(#kc-totp-settings-form) {
  min-height: 100svh;
  color: #fff;
  background:
    radial-gradient(circle at 27% 46%, rgba(116,66,214,.22), transparent 30%),
    radial-gradient(circle at 77% 32%, rgba(28,144,210,.15), transparent 25%),
    linear-gradient(125deg, #0b0610, #2b0714 52%, #4a0f21) !important;
  background-attachment: fixed !important;
  font-family: "SATU Poppins", Arial, Helvetica, sans-serif;
}

body:has(#kc-totp-settings-form)::before {
  z-index: 0;
  opacity: .38;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(255,255,255,.76) 0 1px, transparent 1.6px),
    radial-gradient(circle at 73% 19%, rgba(160,213,255,.72) 0 1px, transparent 1.7px),
    radial-gradient(circle at 88% 71%, rgba(255,194,217,.75) 0 1px, transparent 1.6px),
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 151px 157px, 223px 229px, 283px 271px, 72px 72px, 72px 72px;
}

body:has(#kc-totp-settings-form)::after {
  content: "SATU // COMMAND     ─────     MFA ENROLLMENT";
  position: fixed;
  z-index: 30;
  top: 18px;
  left: 50%;
  color: rgba(123,213,255,.66);
  font-family: "SATU Michroma", sans-serif;
  font-size: 7px;
  letter-spacing: .14em;
  pointer-events: none;
  transform: translateX(-50%);
}

body:has(#kc-totp-settings-form) .pf-v5-c-login__main,
body:has(#kc-totp-settings-form) .pf-c-login__main,
body:has(#kc-totp-settings-form) .card-pf {
  border: 1px solid rgba(117,199,242,.22) !important;
  border-radius: 5px 28px 5px 28px !important;
  color: #fff !important;
  background: linear-gradient(145deg, rgba(16,23,40,.94), rgba(64,14,37,.91)) !important;
  box-shadow: 0 34px 85px rgba(0,0,0,.4), inset 0 1px rgba(255,255,255,.08) !important;
  backdrop-filter: blur(24px);
}

body:has(#kc-totp-settings-form) #kc-page-title {
  color: #fff7e5 !important;
  font-family: "SATU Michroma", sans-serif !important;
  font-size: clamp(27px, 3vw, 38px) !important;
  font-weight: 400 !important;
  line-height: 1.16 !important;
  letter-spacing: -.035em !important;
}

body:has(#kc-totp-settings-form) #kc-totp-settings > li {
  border: 1px solid rgba(117,199,242,.15) !important;
  color: rgba(255,255,255,.76) !important;
  background: linear-gradient(135deg, rgba(255,255,255,.075), rgba(255,255,255,.035)) !important;
  box-shadow: inset 0 1px rgba(255,255,255,.04);
}

body:has(#kc-totp-settings-form) #kc-totp-settings > li::before {
  color: #28101b !important;
  background: linear-gradient(135deg, #ffe3a1, #ff8fb8) !important;
  box-shadow: 0 6px 18px rgba(230,105,176,.2);
}

body:has(#kc-totp-settings-form) #kc-totp-settings p,
body:has(#kc-totp-settings-form) #kc-totp-settings li,
body:has(#kc-totp-settings-form) #kc-totp-settings a { color: rgba(255,255,255,.76) !important; }

body:has(#kc-totp-settings-form) #kc-totp-settings a {
  color: #f2bfd4 !important;
  text-decoration-color: rgba(242,191,212,.45) !important;
}

body:has(#kc-totp-settings-form) #kc-totp-supported-apps li {
  border: 1px solid rgba(255,176,209,.2) !important;
  color: #ffe4ef !important;
  background: rgba(212,76,132,.14) !important;
}

body:has(#kc-totp-settings-form) #kc-totp-secret-qr-code {
  border: 1px solid rgba(117,199,242,.28) !important;
  background: #fff !important;
  box-shadow: 0 16px 34px rgba(0,0,0,.28) !important;
}

body:has(#kc-totp-settings-form) #kc-totp-settings-form {
  border-color: rgba(255,255,255,.12) !important;
}

body:has(#kc-totp-settings-form) .pf-v5-c-form__label,
body:has(#kc-totp-settings-form) .pf-v5-c-form__label-text,
body:has(#kc-totp-settings-form) label,
body:has(#kc-totp-settings-form) .pf-v5-c-check__label {
  color: rgba(255,255,255,.8) !important;
  font-family: "SATU Poppins", sans-serif;
}

body:has(#kc-totp-settings-form) input.satu-otp-digit {
  height: 52px;
  border: 1px solid rgba(135,207,244,.3) !important;
  border-radius: 4px 13px 4px 13px !important;
  color: #35131f !important;
  background: linear-gradient(145deg, #fff, #fff7fa) !important;
  box-shadow: 0 9px 22px rgba(0,0,0,.16) !important;
  font-family: "SATU Poppins", sans-serif !important;
  font-size: 20px !important;
}

body:has(#kc-totp-settings-form) input.satu-otp-digit:focus {
  border-color: #75d9ff !important;
  box-shadow: 0 0 0 3px rgba(83,201,255,.14), 0 10px 26px rgba(0,0,0,.2) !important;
}

body:has(#kc-totp-settings-form) #userLabel {
  min-height: 48px;
  border: 1px solid rgba(135,207,244,.3) !important;
  border-radius: 4px 13px 4px 13px !important;
  color: #fff !important;
  background: rgba(255,255,255,.07) !important;
  box-shadow: none !important;
  font-family: "SATU Poppins", sans-serif;
}

body:has(#kc-totp-settings-form) #userLabel:focus {
  border-color: #75d9ff !important;
  box-shadow: 0 0 0 3px rgba(83,201,255,.14) !important;
}

body:has(#kc-totp-settings-form) #saveTOTPBtn,
body:has(#kc-totp-settings-form) input[type="submit"],
body:has(#kc-totp-settings-form) button[type="submit"] {
  min-height: 50px;
  border: 0 !important;
  border-radius: 4px 14px 4px 14px !important;
  color: #261019 !important;
  background: linear-gradient(100deg, #f9d47e, #ff9f70 51%, #e669b0) !important;
  box-shadow: 0 16px 34px rgba(224,76,137,.18) !important;
  font-family: "SATU Poppins", sans-serif;
  font-weight: 800;
}

body:has(#kc-totp-settings-form) .pf-v5-c-alert,
body:has(#kc-totp-settings-form) .pf-c-alert {
  border: 1px solid rgba(255,126,172,.28) !important;
  color: #ffe8f0 !important;
  background: rgba(116,25,57,.38) !important;
}

body:has(#kc-totp-settings-form) .pf-v5-c-alert__title,
body:has(#kc-totp-settings-form) .pf-c-alert__title,
body:has(#kc-totp-settings-form) .kc-feedback-text {
  color: #ffe8f0 !important;
}

body:has(#kc-totp-settings-form) .pf-v5-c-alert__icon,
body:has(#kc-totp-settings-form) .pf-c-alert__icon { color: #ffb7d2 !important; }

@media (max-width: 1050px) {
  body:has(#kc-totp-settings-form)::after { display: none; }
  body:has(#kc-totp-settings-form) .pf-v5-c-login__container,
  body:has(#kc-totp-settings-form) .pf-c-login__container { align-items: start; }
}

/* Laptop/desktop pendek: pertahankan dua kolom di dalam satu command panel.
   Override lama menjadikannya kartu mobile 600px yang terlalu tinggi. */
@media (min-width: 700px) and (max-width: 1050px) {
  body:has(#kc-totp-settings-form) .pf-v5-c-login__container,
  body:has(#kc-totp-settings-form) .pf-c-login__container,
  body[data-page-id="login-login-config-totp"] .pf-v5-c-login__container:has(#kc-totp-settings),
  body[data-page-id="login-login-config-totp"] .pf-c-login__container:has(#kc-totp-settings) {
    width: min(920px, calc(100% - 40px)) !important;
    min-height: calc(100svh - 74px);
    padding: 22px 0 34px !important;
  }

  body:has(#kc-totp-settings-form) .pf-v5-c-login__main,
  body:has(#kc-totp-settings-form) .pf-c-login__main,
  body:has(#kc-totp-settings-form) .card-pf,
  body[data-page-id="login-login-config-totp"] .pf-v5-c-login__main:has(#kc-totp-settings),
  body[data-page-id="login-login-config-totp"] .pf-c-login__main:has(#kc-totp-settings) {
    width: 100% !important;
    max-width: none !important;
  }

  body:has(#kc-totp-settings-form) .pf-v5-c-login__main-header,
  body:has(#kc-totp-settings-form) .pf-c-login__main-header { padding: 24px 28px 0 !important; }

  body:has(#kc-totp-settings-form) .pf-v5-c-login__main-body,
  body:has(#kc-totp-settings-form) .pf-c-login__main-body {
    display: grid !important;
    grid-template-columns: minmax(0, 1.12fr) minmax(300px, .88fr) !important;
    gap: 0 22px !important;
    align-items: start;
    padding: 16px 28px 25px !important;
  }

  body:has(#kc-totp-settings-form) #kc-totp-settings {
    grid-column: 1;
    margin: 0 !important;
  }

  body:has(#kc-totp-settings-form) #kc-totp-settings-form {
    grid-column: 2;
    align-self: stretch;
    margin: 0;
    padding: 4px 0 0 22px !important;
    border-top: 0 !important;
    border-left: 1px solid rgba(255,255,255,.12) !important;
  }

  body:has(#kc-totp-settings-form) .pf-v5-c-alert,
  body:has(#kc-totp-settings-form) .pf-c-alert { grid-column: 1 / -1; }

  body:has(#kc-totp-settings-form) #kc-totp-secret-qr-code { width: 122px; }
  body:has(#kc-totp-settings-form) #kc-page-title { font-size: clamp(27px, 4vw, 36px) !important; }
}

/* Desktop final: one vertical flow with full-width OTP controls. The three
   instruction cards share one row so the page stays compact without squeezing
   the six authenticator digits into a side column. */
@media (min-width: 700px) {
  body:has(#kc-totp-settings-form) .pf-v5-c-login__container,
  body:has(#kc-totp-settings-form) .pf-c-login__container,
  body[data-page-id="login-login-config-totp"] .pf-v5-c-login__container:has(#kc-totp-settings),
  body[data-page-id="login-login-config-totp"] .pf-c-login__container:has(#kc-totp-settings) {
    grid-template-columns: minmax(0, 1fr) !important;
    width: min(920px, calc(100% - 40px)) !important;
    min-height: calc(100svh - 74px);
    margin-top: 74px;
    padding: 22px 0 34px !important;
  }

  body:has(#kc-totp-settings-form) #kc-header,
  body:has(#kc-totp-settings-form) .satu-auth-orbit { display: none !important; }

  body:has(#kc-totp-settings-form) .pf-v5-c-login__main,
  body:has(#kc-totp-settings-form) .pf-c-login__main,
  body:has(#kc-totp-settings-form) .card-pf,
  body[data-page-id="login-login-config-totp"] .pf-v5-c-login__main:has(#kc-totp-settings),
  body[data-page-id="login-login-config-totp"] .pf-c-login__main:has(#kc-totp-settings) {
    grid-column: 1;
    grid-row: 1;
    width: 100% !important;
    max-width: none !important;
  }

  body:has(#kc-totp-settings-form) .pf-v5-c-login__main-body,
  body:has(#kc-totp-settings-form) .pf-c-login__main-body {
    display: block !important;
    padding: 16px 28px 26px !important;
  }

  body:has(#kc-totp-settings-form) #kc-totp-settings {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin: 0 0 18px !important;
  }

  body:has(#kc-totp-settings-form) #kc-totp-settings > li {
    height: 100%;
    min-height: 150px !important;
    padding: 12px 12px 12px 44px !important;
  }

  body:has(#kc-totp-settings-form) #kc-totp-secret-qr-code {
    width: 104px !important;
    margin: 6px auto !important;
    padding: 6px !important;
  }

  body:has(#kc-totp-settings-form) #kc-totp-settings-form {
    display: block !important;
    width: 100%;
    margin: 0;
    padding: 18px 0 0 !important;
    border-top: 1px solid rgba(255,255,255,.12) !important;
    border-left: 0 !important;
  }

  body:has(#kc-totp-settings-form) .satu-otp-boxes {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 680px;
    margin-inline: auto;
  }

  body:has(#kc-totp-settings-form) input.satu-otp-digit {
    width: 100% !important;
    max-width: none !important;
    height: 58px;
    font-size: 22px !important;
  }

  body:has(#kc-totp-settings-form) .satu-auth-brand { top: -89px !important; left: 1px !important; }
  body:has(#kc-totp-settings-form) .satu-auth-back { top: -75px !important; right: 0 !important; }
}

/* Fluid geometry: square OTP cells and progressive instruction layout prevent
   distorted controls while the desktop window is being resized. */
@media (min-width: 700px) {
  body:has(#kc-totp-settings-form) #kc-totp-settings {
    grid-template-columns: minmax(0, 1fr) minmax(260px, .9fr) !important;
    grid-template-rows: auto auto;
    align-items: stretch;
  }

  body:has(#kc-totp-settings-form) #kc-totp-settings > li {
    height: auto;
    min-height: 0 !important;
  }

  body:has(#kc-totp-settings-form) #kc-totp-settings > li:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }

  body:has(#kc-totp-settings-form) #kc-totp-settings > li:nth-child(2) {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  body:has(#kc-totp-settings-form) #kc-totp-settings > li:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
  }

  body:has(#kc-totp-settings-form) #kc-totp-secret-qr-code {
    width: clamp(104px, 14vw, 132px) !important;
  }

  body:has(#kc-totp-settings-form) .satu-otp-boxes {
    grid-template-columns: repeat(6, minmax(56px, 84px));
    justify-content: center;
    max-width: none;
  }

  body:has(#kc-totp-settings-form) input.satu-otp-digit {
    aspect-ratio: 1 / 1;
    height: auto !important;
    min-height: 0 !important;
  }
}

@media (min-width: 1000px) {
  body:has(#kc-totp-settings-form) #kc-totp-settings {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: auto;
  }

  body:has(#kc-totp-settings-form) #kc-totp-settings > li:nth-child(1),
  body:has(#kc-totp-settings-form) #kc-totp-settings > li:nth-child(2),
  body:has(#kc-totp-settings-form) #kc-totp-settings > li:nth-child(3) {
    grid-column: auto;
    grid-row: auto;
  }
}

/* Shared MFA scale with the recurring verification screen. */
body:has(#kc-totp-settings-form) #kc-page-title::before {
  content: "AKTIVASI DUA LANGKAH";
  display: table;
  margin: 0 0 12px;
  padding: 5px 10px 4px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: #74203f;
  background: linear-gradient(100deg, #ffe8b4, #f5c7dc);
  font-family: "SATU Poppins", sans-serif;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .08em;
}

body:has(#kc-totp-settings-form) #kc-page-title {
  font-size: 34px !important;
  line-height: 1.2 !important;
}

body:has(#kc-totp-settings-form) .pf-v5-c-alert.pf-m-warning,
body:has(#kc-totp-settings-form) .pf-c-alert.pf-m-warning {
  min-height: 0;
  margin: 0 0 16px !important;
  padding: 0 !important;
  border: 0 !important;
  color: rgba(255,255,255,.58) !important;
  background: transparent !important;
  box-shadow: none !important;
}

body:has(#kc-totp-settings-form) .pf-m-warning .pf-v5-c-alert__icon,
body:has(#kc-totp-settings-form) .pf-m-warning .pf-c-alert__icon { display: none !important; }

body:has(#kc-totp-settings-form) .pf-m-warning .pf-v5-c-alert__title,
body:has(#kc-totp-settings-form) .pf-m-warning .pf-c-alert__title,
body:has(#kc-totp-settings-form) .pf-m-warning .kc-feedback-text {
  color: rgba(255,255,255,.58) !important;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
}

body:has(#kc-totp-settings-form) .satu-otp-boxes {
  grid-template-columns: repeat(6, minmax(0, 59px)) !important;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 404px;
  margin-inline: auto;
}

body:has(#kc-totp-settings-form) input.satu-otp-digit {
  aspect-ratio: 1 / 1;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
}

@media (max-width: 650px) {
  body:has(#kc-totp-settings-form) .pf-v5-c-login__container,
  body:has(#kc-totp-settings-form) .pf-c-login__container,
  body[data-page-id="login-login-config-totp"] .pf-v5-c-login__container:has(#kc-totp-settings),
  body[data-page-id="login-login-config-totp"] .pf-c-login__container:has(#kc-totp-settings) {
    width: min(540px, calc(100% - 34px)) !important;
  }

  body:has(#kc-totp-settings-form) .pf-v5-c-login__container,
  body:has(#kc-totp-settings-form) .pf-c-login__container {
    padding: 22px 0 34px !important;
  }

  body:has(#kc-totp-settings-form) .pf-v5-c-login__main,
  body:has(#kc-totp-settings-form) .pf-c-login__main,
  body:has(#kc-totp-settings-form) .card-pf { border-radius: 5px 22px 5px 22px !important; }

  body:has(#kc-totp-settings-form) .pf-v5-c-login__main-header,
  body:has(#kc-totp-settings-form) .pf-c-login__main-header { padding: 24px 23px 0 !important; }

  body:has(#kc-totp-settings-form) .pf-v5-c-login__main-body,
  body:has(#kc-totp-settings-form) .pf-c-login__main-body { padding: 16px 23px 24px !important; }

  body:has(#kc-totp-settings-form) #kc-totp-settings > li { padding-right: 9px !important; }
  body:has(#kc-totp-settings-form) .satu-otp-boxes { gap: 5px; }
  body:has(#kc-totp-settings-form) input.satu-otp-digit {
    aspect-ratio: 1 / 1;
    min-width: 0;
    height: auto !important;
    min-height: 0 !important;
    font-size: clamp(16px, 5vw, 20px) !important;
  }
  body:has(#kc-totp-settings-form) #userLabel { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  body:has(#kc-totp-settings-form) *,
  body:has(#kc-totp-settings-form) *::before,
  body:has(#kc-totp-settings-form) *::after { animation: none !important; transition: none !important; }
}
