@keyframes mpOpeningSpin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes mpOpeningBar {
  0% {
    transform: translateX(-72%);
  }
  100% {
    transform: translateX(172%);
  }
}

.mp-public-static {
  --mp-static-accent: #5d7ff4;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .58fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  padding: clamp(24px, 5vw, 72px);
  background:
    linear-gradient(115deg, rgba(255, 253, 249, .96), rgba(247, 241, 232, .94)),
    radial-gradient(circle at 82% 16%, rgba(93, 127, 244, .12), transparent 30%);
  color: #223047;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.mp-public-static::before {
  content: "";
  position: absolute;
  top: clamp(18px, 3vw, 34px);
  left: clamp(22px, 4vw, 52px);
  width: min(190px, 42vw);
  height: 42px;
  background: url("/assets/brand/mathspilot-logo-lockup.svg") left center / contain no-repeat;
}

.mp-public-static section {
  min-width: 0;
}

.mp-public-static section:first-of-type {
  display: grid;
  gap: 20px;
  align-content: center;
  max-width: 760px;
}

.mp-public-static section:first-of-type > p:first-child {
  margin: 0;
  color: #51617c;
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: 0;
}

.mp-public-static h1 {
  margin: 0;
  max-width: 11ch;
  color: #223047;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 7vw, 5.4rem);
  line-height: .98;
  letter-spacing: 0;
}

.mp-public-static section:first-of-type > p:nth-of-type(2) {
  margin: 0;
  max-width: 42rem;
  color: #48566d;
  font-size: clamp(1.05rem, 1.5vw, 1.28rem);
}

.mp-public-static section:first-of-type > p:nth-of-type(3) {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0 0;
}

.mp-public-static section:first-of-type > p:nth-of-type(3) span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid rgba(55, 66, 99, .15);
  border-radius: 999px;
  background: rgba(255, 253, 249, .72);
  color: #223047;
  font-size: .9rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(15, 18, 34, .05);
}

.mp-public-static section:first-of-type > p:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0 0;
}

.mp-public-static section:first-of-type > p:last-child a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid rgba(55, 66, 99, .18);
  border-radius: 14px;
  background: rgba(255, 253, 249, .88);
  color: #223047;
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(15, 18, 34, .06);
}

.mp-public-static section:first-of-type > p:last-child a:first-child {
  border-color: rgba(93, 127, 244, .28);
  background: linear-gradient(180deg, #7f98ef, #6d86df);
  color: #fff;
  box-shadow: 0 16px 32px rgba(93, 127, 244, .2);
}

.mp-public-static section:nth-of-type(2) {
  display: grid;
  gap: 14px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid rgba(55, 66, 99, .16);
  border-radius: 24px;
  background: rgba(255, 253, 249, .86);
  box-shadow: 0 26px 70px rgba(15, 18, 34, .12), inset 0 1px rgba(255, 255, 255, .86);
}

.mp-public-static section:nth-of-type(2)::before {
  content: "";
  width: 40px;
  height: 40px;
  border: 3px solid rgba(93, 127, 244, .2);
  border-top-color: #5d7ff4;
  border-radius: 50%;
  animation: mpOpeningSpin .85s linear infinite;
}

.mp-public-static section:nth-of-type(2) h2 {
  margin: 0;
  color: #223047;
  font-size: clamp(1.45rem, 2vw, 2rem);
}

.mp-public-static section:nth-of-type(2) p {
  margin: 0;
  color: #5f6d84;
  font-weight: 760;
}

.mp-public-static section:nth-of-type(2)::after {
  content: "Preparing secure sign-in and the MathsPilot workspace.";
  color: #48566d;
  font-size: .95rem;
  line-height: 1.45;
}

.auth-submit-btn.is-loading {
  opacity: 1;
  color: #fff;
}

.auth-submit-btn.is-loading::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 9px;
  border: 2px solid rgba(255, 255, 255, .44);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: -2px;
  animation: mpOpeningSpin .8s linear infinite;
}

.mp-embedded-signin__status.is-loading {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid rgba(93, 127, 244, .22);
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand-100, #eef3ff) 42%, var(--bg-panel, #fffdf9) 58%);
  color: var(--text-body, #48566d);
  font-size: .9rem;
  font-weight: 760;
}

.mp-opening-state {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: clamp(14px, 2vw, 22px);
  align-content: start;
  border: 1px solid rgba(55, 66, 99, .14);
  background:
    linear-gradient(135deg, rgba(255, 253, 249, .96), rgba(247, 241, 232, .9)),
    linear-gradient(180deg, rgba(93, 127, 244, .08), transparent 62%);
  box-shadow: 0 24px 58px rgba(15, 18, 34, .1), inset 0 1px rgba(255, 255, 255, .86);
}

.mp-opening-state__topline {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.mp-opening-state__mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(93, 127, 244, .25);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #edf3ff);
  box-shadow: 0 10px 24px rgba(93, 127, 244, .14);
}

.mp-opening-state__mark::before {
  content: "";
  width: 20px;
  height: 20px;
  border: 3px solid rgba(93, 127, 244, .2);
  border-top-color: #5d7ff4;
  border-radius: 50%;
  animation: mpOpeningSpin .85s linear infinite;
}

.mp-opening-state__kicker {
  margin: 0;
  color: color-mix(in srgb, var(--brand-700, #3f5ea3) 72%, var(--text-strong, #223047) 28%);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.15;
  text-transform: uppercase;
}

.mp-opening-state__title {
  margin: 0;
  color: var(--text-strong, #223047);
  font-size: clamp(1.85rem, 3vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.mp-opening-state__copy {
  margin: 0;
  max-width: 62ch;
  color: var(--text-body, #48566d);
  font-size: clamp(.98rem, 1.2vw, 1.08rem);
}

.mp-opening-state__steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mp-opening-state__step {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(55, 66, 99, .12);
  border-radius: 16px;
  background: rgba(255, 255, 255, .62);
  color: var(--text-body, #48566d);
  font-size: .84rem;
  font-weight: 800;
  line-height: 1.25;
}

.mp-opening-state__step strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text-strong, #223047);
  font-size: .9rem;
}

.mp-opening-state__bar {
  position: relative;
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(55, 66, 99, .1);
}

.mp-opening-state__bar span {
  position: absolute;
  inset-block: 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(93, 127, 244, .12), rgba(93, 127, 244, .8), rgba(37, 104, 72, .62));
  animation: mpOpeningBar 1.45s ease-in-out infinite;
}

.adult-workspace-loading.mp-opening-state {
  padding: clamp(18px, 2.5vw, 30px);
  border-radius: 26px;
}

.adult-workspace-loading .mp-opening-state__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .7fr);
  gap: clamp(18px, 2.4vw, 30px);
  align-items: stretch;
}

.adult-workspace-loading .mp-opening-state__steps {
  align-self: stretch;
  grid-template-columns: 1fr;
}

.student-auth-panel.mp-opening-state {
  padding: clamp(20px, 3vw, 32px);
  border-radius: 24px;
}

@media (prefers-reduced-motion: reduce) {
  .mp-public-static section:nth-of-type(2)::before,
  .auth-submit-btn.is-loading::before,
  .mp-opening-state__mark::before,
  .mp-opening-state__bar span {
    animation: none;
  }
}

@media (max-width: 900px) {
  .mp-public-static,
  .adult-workspace-loading .mp-opening-state__layout {
    grid-template-columns: 1fr;
  }

  .mp-public-static {
    align-items: start;
    padding-top: 92px;
  }

  .mp-opening-state__steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .mp-public-static {
    gap: 18px;
    padding-inline: 18px;
    padding-bottom: 28px;
  }

  .mp-public-static h1 {
    font-size: clamp(2.35rem, 13vw, 3.5rem);
  }

  .mp-public-static section:nth-of-type(2) {
    padding: 18px;
    border-radius: 20px;
  }

  .mp-opening-state__title {
    font-size: clamp(1.55rem, 8vw, 2rem);
  }
}
