/* Customer portal Sign In / Enter Your Code / Create an Account: bottom sheet on phones, centred dialog on desktop */
.portal-body #main-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  overflow: hidden;
  background: rgba(20, 21, 23, 0.5);
}

.portal-body #modal-content.signin-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  max-width: none;
  max-height: 92vh;
  max-height: 92dvh;
  margin: 0 !important;
  padding: 8px 20px calc(24px + env(safe-area-inset-bottom)) !important;
  overflow-y: auto;
  border: 0;
  border-radius: 20px 20px 0 0;
  background: #fff;
  color: #1d1f21;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (max-width: 767px) {
  .portal-body #modal-content.signin-sheet {
    bottom: var(--kb-offset, 0px);
    max-height: min(92vh, var(--kb-max-height, 92vh));
    max-height: min(92dvh, var(--kb-max-height, 92dvh));
  }
}

.profile-sheet-header.signin-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
}

.signin-header .profile-sheet-title {
  grid-column: 2;
  padding-top: 0;
  text-align: center;
}

.portal-body .signin-header #close-modal-btn {
  position: static;
  margin: 0 -10px 0 0;
  color: #1d1f21;
  letter-spacing: 0;
}

#login-register-wrapper,
#login-container,
#registration-container {
  width: 100%;
}

#registration-container {
  display: none;
}

.signin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}

.signin-form > .profile-btn {
  margin-top: 4px;
}

#thir-input-page:empty {
  display: none;
}

.signin-form[hidden],
.signin-switch[hidden] {
  display: none;
}

.signin-msg,
.signin-help {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: #3f4246;
  overflow-wrap: anywhere;
}

.signin-help {
  font-size: 13px;
}

/* Sign In and Create an Account each offer the other as a full button under a labelled divider */
.signin-switch {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.signin-divider {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  color: var(--embed-muted, #5e6066);
}

.signin-divider::before,
.signin-divider::after {
  content: "";
  flex: 1 1 0;
  border-top: 1px solid var(--embed-line, #dfe0e2);
}

.portal-body .signin-switch #login-form-btn,
.portal-body .signin-switch #registration-form-btn {
  width: 100%;
  margin: 0;
  padding: 0 16px;
  border: 1px solid var(--embed-line-strong, #c6c8c5);
  border-radius: var(--embed-r-control, 10px);
  background: var(--embed-surface, #fff);
  color: var(--embed-ink, #1d1f21);
}

.signin-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--embed-r-control, 10px);
  background: var(--embed-fill, #f4f4f5);
  color: var(--embed-soft, #3f4246);
}

.signin-hint-icon {
  flex: none;
  margin-top: 1px;
  color: var(--embed-muted, #5e6066);
}

.signin-hint p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* A link inside running text: sits on the baseline, keeps a taller tap area than the line */
.signin-hint .signin-inline-link {
  position: relative;
  display: inline;
  height: auto;
  margin: 0;
  padding: 0;
  font-size: inherit;
  line-height: inherit;
  color: var(--embed-ink, #1d1f21);
}

.signin-hint .signin-inline-link::after {
  content: "";
  position: absolute;
  inset: -10px -2px;
}

#signin-field-step,
#login-code-wrapper,
#registration-container {
  animation: signin-step-in 180ms ease-out;
}

@keyframes signin-step-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  #signin-field-step,
  #login-code-wrapper,
  #registration-container {
    animation: none;
  }
}

.signin-full {
  width: 100%;
}

.signin-note {
  display: none;
  margin: 0;
  font-size: 14px;
  color: #a82a20;
}

.signin-error {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.4;
  color: #a82a20;
  overflow-wrap: anywhere;
}

.signin-error:empty {
  display: none;
}

.signin-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.signin-phone {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
}

.signin-phone-prefix {
  height: 48px;
  border: 1px solid #b5b8b4;
  border-radius: 10px;
  background: #f0f1f2;
  color: #1d1f21;
  font-size: 16px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.signin-consent p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #5e6066;
}

#login-code-wrapper {
  display: none;
}

/* One real input stretched over five drawn boxes, so focus never moves while a code is typed */
.pin-wrap {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.pin-field {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: transparent;
  font-size: 16px;
  cursor: text;
}

.pin-field::selection {
  background: transparent;
}

.pin-field:-webkit-autofill {
  -webkit-text-fill-color: transparent;
  transition: background-color 600000s 0s;
}

.pin-box {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  border: 1px solid #b5b8b4;
  border-radius: 12px;
  background: #fff;
  color: #1d1f21;
  font-size: 22px;
  font-weight: 700;
}

.pin-box.is-active {
  border-color: #1d1f21;
  box-shadow: 0 0 0 3px #d3dde6;
}

.pin-box.is-active:empty::after {
  content: "";
  width: 2px;
  height: 26px;
  background: #1d1f21;
  animation: pin-caret 1s steps(1) infinite;
}

@keyframes pin-caret {
  50% {
    opacity: 0;
  }
}

.signin-code-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.signin-code-links .code-resend-wrap {
  font-size: 14px;
  color: #5e6066;
}

.signin-code-links .code-resend-wrap:empty,
.signin-code-links .code-timer:empty {
  display: none;
}

@media (min-width: 768px) {
  .portal-body #modal-content.signin-sheet {
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    width: 440px;
    max-height: calc(100vh - 48px);
    padding: 24px !important;
    border-radius: 16px;
    transform: translate(-50%, -50%);
    box-shadow: 0 20px 40px rgba(20, 21, 23, 0.25);
  }

  .portal-body #modal-content.signin-sheet .profile-sheet-grab {
    display: none;
  }
}

@media (max-width: 359px) {
  .signin-two {
    grid-template-columns: minmax(0, 1fr);
  }
}
