.auth-shell {
  position: relative;
  display: flex;
  width: 100%;
  max-width: var(--app-max-width);
  height: min(52.75rem, calc(100svh - 3rem));
  min-height: min(38rem, calc(100svh - 3rem));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgb(23 20 25 / 9%);
  border-radius: var(--radius-xl);
  background: var(--surface-soft);
  box-shadow: var(--shadow-shell);
}

.auth-screen {
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--surface-soft);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.auth-screen::-webkit-scrollbar {
  display: none;
}

.auth-screen:not([hidden]) {
  display: flex;
  animation: auth-screen-enter 240ms var(--ease-out) both;
}

.auth-screen--splash {
  align-items: center;
  justify-content: center;
  padding: calc(2rem + env(safe-area-inset-top)) 1.25rem calc(2rem + env(safe-area-inset-bottom));
  background: var(--surface);
}

.splash-content {
  display: flex;
  width: 100%;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

.auth-logo-window {
  position: relative;
  display: block;
  overflow: hidden;
}

.auth-logo-window img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  max-width: none;
  height: auto;
  pointer-events: none;
  transform: translate(-50%, -50%);
  user-select: none;
  -webkit-user-drag: none;
}

.auth-logo-window--splash {
  width: min(17rem, 84vw);
  height: 6.8rem;
}

.auth-logo-window--login {
  width: 10.5rem;
  height: 4.15rem;
  margin-bottom: 0.7rem;
}

.auth-logo-window--resolution {
  width: 8.8rem;
  height: 3.55rem;
  margin: 0 auto 1.25rem;
}

.auth-logo-window--mini {
  width: 6.8rem;
  height: 2.7rem;
}

.splash-content > p {
  margin-top: 0.65rem;
  color: var(--ink-subtle);
  font-size: 0.74rem;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.splash-progress {
  position: relative;
  display: block;
  width: 4.5rem;
  height: 0.22rem;
  margin-top: 1.5rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-neutral);
}

.splash-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 45%;
  border-radius: inherit;
  background: var(--brand-pink-600);
  animation: splash-progress 900ms ease-in-out infinite alternate;
}

.auth-screen--form {
  align-items: flex-start;
  justify-content: center;
}

.auth-content {
  width: 100%;
  padding: calc(1.1rem + env(safe-area-inset-top)) 1rem calc(1.35rem + env(safe-area-inset-bottom));
}

.auth-content--register {
  padding-top: calc(0.9rem + env(safe-area-inset-top));
}

.auth-intro {
  margin-bottom: 1.1rem;
}

.auth-eyebrow {
  color: var(--brand-pink-700);
  font-size: 0.66rem;
  font-weight: 820;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
}

.auth-intro h1,
.resolution-content h1 {
  margin-top: 0.38rem;
  color: var(--charcoal-950);
  font-size: clamp(1.7rem, 7vw, 2rem);
  font-weight: 820;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.auth-intro > p:last-child,
.resolution-content > p {
  max-width: 21rem;
  margin-top: 0.55rem;
  color: var(--ink-subtle);
  font-size: 0.82rem;
  line-height: 1.55;
}

.auth-intro--register {
  margin-top: 1rem;
}

.auth-top-row {
  display: flex;
  min-height: var(--tap-target);
  align-items: center;
  justify-content: space-between;
}

.auth-notice {
  margin-bottom: 0.9rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--brand-pink-100);
  border-radius: var(--radius-sm);
  background: var(--brand-pink-050);
  color: var(--brand-pink-700);
  font-size: 0.74rem;
  font-weight: 680;
  line-height: 1.45;
}

.auth-form {
  display: grid;
  gap: 0.85rem;
}

.form-field {
  display: grid;
  gap: 0.4rem;
}

.form-field__label {
  color: var(--charcoal-800);
  font-size: 0.74rem;
  font-weight: 740;
  line-height: 1.25;
}

.input-control {
  display: flex;
  min-height: 3.15rem;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.75rem;
  background: var(--surface);
  color: var(--charcoal-500);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.input-control:hover {
  border-color: #c7c0ca;
}

.input-control:focus-within {
  border-color: var(--brand-pink-600);
  box-shadow: 0 0 0 3px rgb(99 2 195 / 10%);
  background: var(--surface);
}

.input-control:has(input[aria-invalid="true"]) {
  border-color: #a64055;
  box-shadow: 0 0 0 3px rgb(166 64 85 / 9%);
}

.input-control > svg {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}

.input-control input {
  width: 100%;
  min-width: 0;
  min-height: 3rem;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--charcoal-950);
  font-size: 0.84rem;
  line-height: 1.2;
}

.input-control input::placeholder {
  color: #9d979f;
  opacity: 1;
}

.input-control--text-only {
  padding-left: 0.9rem;
}

.password-toggle {
  min-width: var(--tap-target);
  min-height: var(--tap-target);
  padding: 0 0.15rem;
  background: transparent;
  color: var(--brand-pink-700);
  cursor: pointer;
  font-size: 0.69rem;
  font-weight: 780;
}

.auth-form__utility {
  display: flex;
  min-height: 1.25rem;
  align-items: center;
  justify-content: space-between;
  margin-top: -0.2rem;
}

.text-button {
  min-width: var(--tap-target);
  min-height: var(--tap-target);
  padding: 0.35rem 0;
  background: transparent;
  color: var(--brand-pink-700);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 780;
  line-height: 1.25;
}

.text-button:hover {
  color: var(--brand-pink-600);
  text-decoration: underline;
  text-underline-offset: 0.18rem;
}

.form-error {
  margin-top: -0.2rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #ecd2d8;
  border-radius: var(--radius-sm);
  background: #fff6f8;
  color: #8f3146;
  font-size: 0.73rem;
  font-weight: 650;
  line-height: 1.45;
}

.auth-form__switch {
  color: var(--ink-subtle);
  font-size: 0.74rem;
  line-height: 1.4;
  text-align: center;
}

.auth-form__switch .text-button {
  margin-left: 0.2rem;
}

.demo-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-neutral);
}

.demo-account > div {
  min-width: 0;
}

.demo-account strong {
  color: var(--charcoal-800);
  font-size: 0.72rem;
  line-height: 1.25;
}

.demo-account p {
  margin-top: 0.12rem;
  color: var(--ink-subtle);
  font-size: 0.7rem;
  font-weight: 650;
}

.demo-account span {
  display: block;
  margin-top: 0.18rem;
  color: var(--ink-muted);
  font-size: 0.65rem;
  line-height: 1.35;
}

.auth-screen--resolution {
  align-items: center;
  justify-content: center;
  padding: calc(1.5rem + env(safe-area-inset-top)) 1rem calc(1.5rem + env(safe-area-inset-bottom));
}

.resolution-content {
  width: 100%;
  text-align: center;
}

.resolution-check {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  place-items: center;
  border: 1px solid var(--brand-pink-200);
  border-radius: 50%;
  background: var(--brand-pink-050);
  color: var(--brand-pink-600);
}

.resolution-check svg {
  width: 1.65rem;
  height: 1.65rem;
}

.resolution-check--empty {
  border-color: var(--line-strong);
  background: var(--surface-neutral);
  color: var(--charcoal-600);
}

.resolution-content > p {
  margin-right: auto;
  margin-left: auto;
}

.session-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  margin-top: 1.35rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: left;
}

.session-summary img {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
}

.session-summary div {
  min-width: 0;
}

.session-summary strong {
  display: block;
  overflow: hidden;
  color: var(--charcoal-900);
  font-size: 0.78rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-summary p {
  margin-top: 0.12rem;
  color: var(--ink-muted);
  font-size: 0.67rem;
  line-height: 1.35;
}

.resolution-handoff {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  margin: 0.85rem 0 1rem;
  padding: 0.85rem;
  border: 1px solid var(--brand-pink-100);
  border-radius: var(--radius-md);
  background: var(--brand-pink-050);
  text-align: left;
}

.resolution-handoff > span {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 0.55rem;
  background: var(--surface);
  color: var(--brand-pink-600);
}

.resolution-handoff svg {
  width: 1.1rem;
  height: 1.1rem;
}

.resolution-handoff strong {
  color: var(--charcoal-900);
  font-size: 0.76rem;
  line-height: 1.35;
}

.resolution-handoff p {
  margin-top: 0.22rem;
  color: var(--ink-subtle);
  font-size: 0.69rem;
  line-height: 1.45;
}

.auth-toast-region {
  bottom: calc(0.85rem + env(safe-area-inset-bottom));
}

@keyframes splash-progress {
  from {
    transform: translateX(-20%);
  }
  to {
    transform: translateX(140%);
  }
}

@keyframes auth-screen-enter {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 479px) {
  .auth-shell {
    max-width: none;
    height: 100vh;
    height: 100svh;
    min-height: 100vh;
    min-height: 100svh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (max-width: 370px) {
  .auth-content,
  .auth-screen--resolution {
    padding-right: 0.8rem;
    padding-left: 0.8rem;
  }

  .session-summary {
    gap: 0.55rem;
    padding: 0.75rem;
  }

  .session-summary .badge {
    padding-right: 0.45rem;
    padding-left: 0.45rem;
    font-size: 0.6rem;
  }
}
