.iam-entry-tabs { display:flex; gap:4px; padding:4px; margin:16px 0 24px; background:var(--pp-surface-2,#f3f4f5); border-radius:8px; }
.iam-entry-tabs button { flex:1; padding:12px; border:0; border-radius:8px; background:transparent; color:var(--pp-text-2,#65676a); font:inherit; font-size:14px; cursor:pointer; }
.iam-entry-tabs button[aria-selected='true'] { background:var(--pp-surface,#fff); color:var(--pp-text,#101112); }
.iam-entry-tabs button:focus-visible,.iam-code-form input:focus-visible { outline:2px solid var(--pp-text,#101112); outline-offset:2px; }
.pp-auth #form-login[hidden],.iam-code-form[hidden] { display:none !important; }
.iam-code-form { display:flex; flex-direction:column; gap:12px; color:var(--pp-text,#101112); }
.iam-code-form label { font-size:14px; }
.iam-code-form input { box-sizing:border-box; width:100%; padding:16px; border:0; border-radius:8px; background:var(--pp-surface-2,#f1f2f3); color:inherit; font:inherit; letter-spacing:8px; }
.iam-code-form p { margin:0; font-size:13px; line-height:1.6; color:var(--pp-text-2,#65676a); }
.iam-code-form p[role='status']:empty { display:none; }
.iam-code-form button { padding:16px; border:0; border-radius:8px; color:var(--pp-on-fill,#fff); background:var(--pp-fill,#101112); font:inherit; cursor:pointer; }
.iam-code-form button:disabled { opacity:.5; cursor:wait; }

/* Align the second-factor form with the surrounding authentication card. */
#second-factor-stage .pp-auth .MuiGrid-direction-xs-column {
  width: 100% !important;
  min-width: 0 !important;
  align-items: stretch !important;
}

#second-factor-stage .pp-auth .MuiGrid-direction-xs-column > .MuiGrid-root {
  width: 100% !important;
  min-width: 0 !important;
}

#second-factor-stage .pp-auth .MuiGrid-direction-xs-column > .MuiBox-root {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

#second-factor-stage .pp-auth .MuiGrid-grid-xs-12:has(> #logout-button) {
  font-size: 0 !important;
}

#second-factor-stage .pp-auth .MuiGrid-grid-xs-12:has(> #logout-button) .MuiButtonBase-root {
  font-size: 13px !important;
}

#second-factor-stage .pp-auth #2fa-container,
#second-factor-stage .pp-auth #2fa-container > .MuiBox-root,
#second-factor-stage .pp-auth #2fa-container #authenticated-stage {
  box-sizing: border-box !important;
  width: 100% !important;
}

#second-factor-stage .pp-auth #2fa-container #authenticated-stage {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
}

#second-factor-stage .pp-auth #register-link,
#second-factor-stage .pp-auth #selection-link {
  box-sizing: border-box !important;
  width: 100% !important;
  margin-top: 16px !important;
  justify-content: center !important;
}

/* Keep the sign-in form compact while preserving its existing controls. */
#first-factor-stage.pp-auth-stage {
  padding: 16px !important;
}

#first-factor-stage .pp-auth {
  padding: 24px !important;
}

#first-factor-stage .pp-auth__brand {
  margin-bottom: 16px !important;
}

#first-factor-stage .pp-auth h5,
#first-factor-stage .pp-auth .MuiTypography-h5 {
  margin-bottom: 8px !important;
}

#first-factor-stage .pp-auth .iam-entry-tabs {
  margin: 8px 0 16px !important;
}

#first-factor-stage .pp-auth #form-login > .MuiGrid-container {
  gap: 16px !important;
  row-gap: 16px !important;
}

#first-factor-stage .pp-auth__foot {
  margin-top: 16px !important;
  padding-top: 16px !important;
}

/* Keep sign-in options compact and account actions on one line. */
#first-factor-stage .pp-auth .iam-entry-tabs {
  width: fit-content;
  max-width: 100%;
}

#first-factor-stage .pp-auth .iam-entry-tabs button {
  flex: 0 1 auto;
  min-height: 36px;
  padding: 8px 16px;
  line-height: 20px;
}

#first-factor-stage .pp-auth #form-login .MuiGrid-root:has(> #reset-password-button) {
  display: flex;
  align-items: center;
  justify-content: space-between !important;
  gap: 16px;
}

#first-factor-stage .pp-auth .iam-inline-register {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--pp-text-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

#first-factor-stage .pp-auth .iam-inline-register:hover {
  color: var(--pp-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

#first-factor-stage .pp-auth .iam-inline-register:focus-visible {
  outline: 2px solid var(--pp-focus);
  outline-offset: 2px;
}

#first-factor-stage .pp-auth__foot {
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

#first-factor-stage .pp-auth[data-iam-code='false']:has(.iam-inline-register) .pp-auth__foot .pp-auth__register {
  display: none !important;
}

/* Place guest access beside the remember-me control. */
#first-factor-stage .pp-auth .iam-entry-tabs[hidden] {
  display: none !important;
}

#first-factor-stage .pp-auth .iam-remember-actions {
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#first-factor-stage .pp-auth .iam-entry-guest,
#first-factor-stage .pp-auth .iam-entry-tabs button {
  flex: none;
  min-height: 28px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--pp-text-2);
  font-family: var(--pp-font);
  font-size: 13px;
  line-height: 20px;
  cursor: pointer;
}

#first-factor-stage .pp-auth .iam-entry-guest:hover,
#first-factor-stage .pp-auth .iam-entry-tabs button:hover {
  color: var(--pp-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

#first-factor-stage .pp-auth .iam-entry-guest:focus-visible,
#first-factor-stage .pp-auth .iam-entry-tabs button:focus-visible {
  outline: 2px solid var(--pp-focus);
  outline-offset: 2px;
}

#first-factor-stage .pp-auth .iam-entry-tabs {
  padding: 0;
  background: transparent;
}

/* Guest entry uses the same compact hierarchy as the sign-in card. */
#first-factor-stage .pp-auth[data-iam-code='true'] .MuiTypography-h5 {
  display: none !important;
}

#first-factor-stage .pp-auth .iam-code-form {
  gap: 16px;
}

#first-factor-stage .pp-auth .iam-code-heading {
  margin: 0;
  color: var(--pp-text);
  font-family: var(--pp-font);
  font-size: 19px;
  font-weight: 600;
  line-height: 28px;
}

#first-factor-stage .pp-auth .iam-code-form input {
  box-sizing: border-box;
  min-height: 48px;
  letter-spacing: 0.12em;
}

#first-factor-stage .pp-auth .iam-code-form input::placeholder {
  letter-spacing: normal;
}

#first-factor-stage .pp-auth .iam-code-form .iam-entry-normal {
  min-height: 44px;
  background: transparent;
  color: var(--pp-text-2);
}

#first-factor-stage .pp-auth .iam-code-form .iam-entry-normal:hover {
  background: var(--pp-hover);
  color: var(--pp-text);
}

#first-factor-stage .pp-auth .iam-code-form .iam-entry-normal:focus-visible {
  outline: 2px solid var(--pp-focus);
  outline-offset: 2px;
}
