.qp-signin-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
}
/* One sign-in card for everyone (quizpulse_auth.js): QuizPulse's name and the language switch on top, a title, the
   organization signed in to, the form, an "or" line with the guest button, and small links in a footer row. The
   personal account and organization panels use the same card. Colours come from the theme's tokens. */
.qp-signin-panel {
  --qp-signin-accent: var(--qp-style-accent, #5b3fd6);
  --qp-signin-soft: var(--qp-style-accent-soft, #efedfe);
  --qp-signin-line: var(--qp-style-border, #e3e1f4);
  --qp-signin-muted: var(--qp-style-muted, #6f6a7d);
  width: min(100%, 560px);
  padding: 24px 34px 28px;
  box-sizing: border-box;
  border: 1px solid var(--qp-signin-line);
  border-radius: 28px;
  background: #fff;
  color: #15162b;
  box-shadow: 0 28px 80px rgba(12, 6, 48, .32);
}
.qp-signin-panel[dir="rtl"] { text-align: right; }

/* The top row: QuizPulse, and English / Arabic. */
.qp-signin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.qp-signin-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 900; letter-spacing: 0; }
.qp-signin-brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--qp-signin-accent);
  color: #fff;
  font-size: 18px;
}
.qp-signin-language {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--qp-signin-line);
  border-radius: 999px;
  background: transparent;
  color: var(--qp-signin-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.qp-signin-language span { padding: 4px 10px; border-radius: 999px; }
.qp-signin-language span[aria-current="true"] { background: var(--qp-signin-soft); color: var(--qp-signin-accent); }
.qp-signin-language:focus-visible { outline: 3px solid #9879ff; outline-offset: 3px; }

.qp-signin-title { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 900; }
.qp-signin-main-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.qp-signin-university-logo {
  display: grid;
  place-items: center;
  min-height: 190px;
  margin: 0 auto 4px;
}
.qp-signin-university-logo img {
  display: block;
  width: min(210px, 52vw);
  max-height: 210px;
  object-fit: contain;
}
.qp-signin-back {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0 0 14px;
  border: 1px solid var(--qp-signin-line);
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font-size: 22px;
  cursor: pointer;
}
.qp-signin-panel[dir="rtl"] .qp-signin-back span { display: inline-block; transform: scaleX(-1); }
.qp-signin-back:focus-visible { outline: 3px solid #9879ff; outline-offset: 4px; }

/* The organization signed in to, under the title. */
.qp-signin-organization {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 6px 0 0;
  color: var(--qp-signin-accent);
  font-size: 14px;
}
.qp-signin-organization strong { font-weight: 800; overflow-wrap: anywhere; }
.qp-signin-organization button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--qp-signin-muted);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.qp-signin-organization button:focus-visible { outline: 3px solid #9879ff; outline-offset: 3px; }
/* An organization being set up signs in its admins only: said on a line of its own. */
.qp-signin-admins-only { flex-basis: 100%; color: var(--qp-signin-muted); font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }

.qp-signin-uims-note {
  margin: 16px 0 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--qp-signin-soft);
  color: var(--qp-signin-accent);
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
}
.qp-signin-panel .qp-auth-notice { margin: 14px 0 0; }
.qp-signin-panel form { margin-top: 4px; }
.qp-signin-panel .qp-label { display: block; margin: 16px 0 7px; color: inherit; font-weight: 800; }
.qp-signin-panel .qp-input { width: 100%; min-height: 48px; box-sizing: border-box; }
.qp-signin-field-control {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 56px;
  border: 1px solid #d9d8ec;
  border-radius: 14px;
  background: #faf9ff;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.qp-signin-field-control:focus-within {
  border-color: var(--qp-signin-accent);
  background: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--qp-signin-accent) 14%, transparent);
}
.qp-signin-field-control .qp-input {
  min-height: 54px;
  padding-inline: 52px 16px;
  border: 0 !important;
  border-radius: inherit;
  background: transparent !important;
  color: #15162b !important;
  box-shadow: none !important;
}
.qp-signin-field-control .qp-input::placeholder { color: #76758f; opacity: 1; }
.qp-signin-field-icon {
  position: absolute;
  inset-inline-start: 17px;
  top: 50%;
  width: 24px;
  height: 24px;
  color: #605d87;
  transform: translateY(-50%);
  pointer-events: none;
}
.qp-signin-field-icon svg,
.qp-signin-guest-icon svg,
.qp-signin-option-icon svg { display: block; width: 100%; height: 100%; }
.qp-signin-password-control .qp-input { padding-inline-end: 52px; }
.qp-signin-password-control .qp-password-toggle { inset-inline-end: 10px; color: #605d87; }
.qp-signin-panel[dir="rtl"] .qp-signin-field-control .qp-input {
  padding-right: 52px;
  padding-left: 16px;
  text-align: right;
}
.qp-signin-panel[dir="rtl"] .qp-signin-password-control .qp-input { padding-left: 52px; }
.qp-signin-panel[dir="rtl"] .qp-signin-password-control .qp-password-toggle {
  right: auto;
  left: 10px;
}
.qp-signin-panel .qp-signin-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  min-height: 50px;
  font-size: 17px;
}
.qp-signin-panel[dir="rtl"] .qp-signin-submit-arrow { transform: scaleX(-1); }
.qp-signin-submit[aria-busy="true"] { opacity: .6; cursor: wait; }
/* How long a sign-in is taking, over the button: said only after a moment, "Checking with UIMS…" where UIMS may be
   the wait. */
.qp-signin-progress { margin: 16px 0 0; color: var(--qp-signin-muted); font-weight: 700; text-align: center; }
.qp-signin-progress:empty { display: none; }
.qp-signin-panel .qp-signin-progress + .qp-signin-submit { margin-top: 10px; }
.qp-signin-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* "or", then the guest button. */
.qp-signin-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--qp-signin-muted); font-size: 13px; }
.qp-signin-divider::before,
.qp-signin-divider::after { content: ""; flex: 1; height: 1px; background: var(--qp-signin-line); }
.qp-signin-panel .qp-signin-guest {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  border: 1px solid color-mix(in srgb, var(--qp-signin-accent) 28%, #d9d8ec);
  background: #fbfaff;
  color: var(--qp-signin-accent);
  font-weight: 850;
}
.qp-signin-guest-icon { width: 25px; height: 25px; flex: 0 0 auto; }

/* Small links in one footer row: a personal account, a new one, another organization. */
.qp-signin-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 10px;
  margin: 18px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--qp-signin-line);
}
.qp-signin-links button,
.qp-signin-links a {
  padding: 0;
  border: 0;
  background: none;
  color: var(--qp-signin-accent);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.qp-signin-links button:hover,
.qp-signin-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.qp-signin-links button:focus-visible,
.qp-signin-links a:focus-visible { outline: 3px solid #9879ff; outline-offset: 3px; }

.qp-signin-links .qp-signin-option-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  min-height: 142px;
  padding: 14px;
  border: 1px solid #e1dff0;
  border-radius: 16px;
  background: #fbfaff;
  color: #15162b;
  text-align: start;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.qp-signin-links .qp-signin-option-card:hover {
  border-color: color-mix(in srgb, var(--qp-signin-accent) 48%, #e1dff0);
  background: #fff;
  box-shadow: 0 10px 24px rgba(60, 38, 132, .1);
  text-decoration: none;
  transform: translateY(-2px);
}
.qp-signin-option-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 8px;
  box-sizing: border-box;
  border-radius: 12px;
  background: var(--qp-signin-soft);
  color: var(--qp-signin-accent);
}
.qp-signin-option-copy { display: grid; gap: 4px; min-width: 0; }
.qp-signin-option-copy strong { color: #15162b; font-size: 14px; line-height: 1.25; }
.qp-signin-option-copy small { color: #716f82; font-size: 12px; font-weight: 650; line-height: 1.35; }
.qp-signin-option-arrow {
  position: absolute;
  inset-block-start: 18px;
  inset-inline-end: 14px;
  color: var(--qp-signin-accent);
  font-size: 18px;
}
.qp-signin-panel[dir="rtl"] .qp-signin-option-arrow { transform: scaleX(-1); }

/* Choosing an organization by its web name. The web name is Latin, so its row stays left to right. */
.qp-signin-slug { display: flex; align-items: center; gap: 8px; direction: ltr; }
.qp-signin-slug > span { color: var(--qp-signin-muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; }
.qp-signin-panel .qp-signin-slug .qp-input { flex: 1; min-width: 0; }
.qp-signin-hint { margin: 8px 0 0; color: var(--qp-signin-muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }

/* An organization or group page that cannot sign anyone in */
.qp-signin-organization-problem { display: grid; gap: 12px; text-align: center; }
.qp-signin-organization-problem h2 { margin: 0; font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; }
.qp-signin-organization-problem p { margin: 0 0 8px; color: var(--qp-signin-muted); line-height: 1.6; }

/* Personal accounts, in their own panels: a heading, an inline error, the wide code field, and a switch line. */
.qp-signin-heading { margin: 0 0 4px; }
.qp-signin-heading h2 { margin: 0; font-size: 22px; line-height: 1.25; }
.qp-signin-heading p { margin: 8px 0 0; color: var(--qp-signin-muted); line-height: 1.5; overflow-wrap: anywhere; }
.qp-signin-panel .qp-signin-text-submit { font-size: 17px; }
.qp-signin-panel .qp-signin-resend { margin-top: 12px; min-height: 46px; }
.qp-signin-panel .qp-signin-code { font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: .4em; text-align: center; direction: ltr; }
.qp-signin-error { margin: 14px 0 0; color: var(--qpt-danger, #dc2626); font-weight: 700; line-height: 1.4; }
.qp-signin-error:empty { display: none; }
.qp-signin-switch { margin: 16px 0 0; color: var(--qp-signin-muted); line-height: 1.6; text-align: center; }
.qp-signin-switch button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--qp-signin-accent);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.qp-signin-switch button:focus-visible { outline: 3px solid #9879ff; outline-offset: 3px; }

@media (max-width: 600px) {
  .qp-signin-shell { padding: 20px 16px; }
  .qp-signin-panel { padding: 18px 18px 20px; border-radius: 22px; }
  .qp-signin-title { font-size: 23px; }
  .qp-signin-university-logo { min-height: 154px; }
  .qp-signin-university-logo img { width: min(170px, 48vw); max-height: 170px; }
  .qp-signin-option-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 390px) {
  .qp-signin-option-grid { grid-template-columns: 1fr; }
  .qp-signin-links .qp-signin-option-card { min-height: 104px; }
}
