/* Butterfly Essentials — auth + onboarding for both designs.
   Mobile follows the app screens (phone, otp, profile, role, stage, due-date, kids, message);
   desktop puts the same forms in a card next to a brand panel. */

/* ---------- Shared pieces ---------- */
.be-auth-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.be-auth-copy--left {
  align-items: flex-start;
  text-align: left;
}

.be-auth-title {
  font-weight: 600;
  outline: none;
}

.be-auth-title em {
  font-style: italic;
  font-weight: 700;
}

.be-auth-lead {
  max-width: 34rem;
  font-size: 12px;
  line-height: 18px;
  color: var(--be-muted);
}

.be-auth-lead--left {
  text-align: left;
}

.be-auth-lead__strong {
  color: var(--be-ink);
  font-weight: 600;
  white-space: nowrap;
}

.be-auth-inline-link {
  color: var(--be-coral);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: 0;
  padding: 0;
}

.be-auth-inline-link[hidden] {
  display: none;
}

.be-auth-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  color: var(--be-ink);
}

.be-auth-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.be-auth-error:empty {
  display: none;
}

.be-auth-error {
  margin-top: 8px;
}

.be-auth-note {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--be-color-status-success, #dce8cf);
  color: #2b5a1f;
  font-size: 12px;
  line-height: 18px;
}

.be-auth-note svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.be-auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.be-auth-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--be-ink);
  cursor: pointer;
}

.be-auth-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--be-coral);
}

.be-auth-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding-top: 24px;
}

.be-auth-cta--tight {
  padding-top: 12px;
}

.be-auth-cta .be-btn {
  width: 100%;
}

.be-auth-legal {
  font-size: 12px;
  line-height: 18px;
  color: var(--be-muted);
  text-align: center;
}

.be-auth-legal a {
  color: var(--be-coral);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.be-auth-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--be-ink);
}

.be-auth-switch svg {
  color: var(--be-coral);
}

.be-auth-switch:hover {
  color: var(--be-coral);
}

.be-auth-alt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
}

.be-auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--be-muted);
}

.be-auth-or::before,
.be-auth-or::after {
  content: "";
  flex: 1;
  border-top: 1px dashed var(--be-blush-line);
}

/* Phone field: flag + prefix + divider */
.be-auth-phone {
  margin-top: 24px;
}

.be-auth-fields .be-auth-phone {
  margin-top: 0;
}

.be-auth-phone__code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.be-auth-phone__flag {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.be-auth-phone__prefix {
  font-size: 14px;
  font-weight: 500;
  color: var(--be-ink);
}

.be-auth-phone__divider {
  width: 1px;
  height: 24px;
  background: var(--be-line);
  flex-shrink: 0;
}

.be-field input {
  min-height: 52px;
}

.be-field input[aria-invalid="true"] {
  color: var(--be-ink);
}

/* Password reveal */
.be-auth-reveal {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-right: -8px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--be-muted);
}

.be-auth-reveal[hidden] {
  display: none;
}

.be-auth-reveal__hide,
.be-auth-reveal[aria-pressed="true"] .be-auth-reveal__show {
  display: none;
}

.be-auth-reveal[aria-pressed="true"] .be-auth-reveal__hide {
  display: block;
}

/* Spinner inside buttons */
.be-auth-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(90, 35, 51, 0.25);
  border-top-color: var(--be-ink);
  border-radius: 50%;
  animation: be-auth-spin 0.7s linear infinite;
}

.be-btn.is-loading {
  pointer-events: none;
}

.be-btn.is-loading .be-auth-spinner {
  display: block;
}

.be-btn.is-loading svg {
  display: none;
}

@keyframes be-auth-spin {
  to { transform: rotate(360deg); }
}

/* OTP boxes: one real input under decorative boxes */
.be-auth-otp {
  position: relative;
  margin: 24px auto 0;
  width: 100%;
  max-width: 360px;
}

.be-auth-fields .be-auth-otp {
  margin-top: 0;
}

.be-auth-otp__input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px;
  letter-spacing: 0;
  opacity: 0.01;
  outline: none;
}

.be-auth-otp__boxes {
  display: grid;
  grid-template-columns: repeat(var(--be-otp-len, 6), minmax(0, 1fr));
  gap: 10px;
}

.be-auth-otp__box {
  display: grid;
  place-items: center;
  height: 60px;
  border-radius: 16px;
  background: var(--be-white);
  border: 1.5px solid var(--be-line);
  font-size: 22px;
  font-weight: 600;
  line-height: 30px;
  color: var(--be-ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.be-auth-otp__box.is-filled {
  border-color: var(--be-coral-soft);
}

.be-auth-otp.is-focused .be-auth-otp__box.is-active,
.be-auth-otp__input:focus + .be-auth-otp__boxes .be-auth-otp__box.is-active {
  border-color: var(--be-coral-soft);
  box-shadow: 0 0 0 3px rgba(255, 139, 122, 0.18);
}

.be-auth-otp.is-error .be-auth-otp__box {
  border-color: var(--be-color-text-error, #b81e40);
}

.be-auth-otp.is-shake {
  animation: be-auth-shake 0.36s ease;
}

@keyframes be-auth-shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* No JS: the boxes cannot show digits, so show the real input instead. */
.be-auth-otp:not(.is-ready) .be-auth-otp__input {
  position: static;
  opacity: 1;
  height: 60px;
  padding: 0 16px;
  border: 1.5px solid var(--be-line);
  border-radius: 16px;
  background: var(--be-white);
  color: var(--be-ink);
  caret-color: var(--be-coral);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-align: center;
}

.be-auth-otp:not(.is-ready) .be-auth-otp__boxes {
  display: none;
}

.be-auth-otp-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.be-auth-otp-meta__row {
  font-size: 14px;
  line-height: 22px;
  color: var(--be-muted);
}

.be-auth-otp-meta__row[hidden],
.be-auth-otp-meta__resend[hidden] {
  display: none;
}

.be-auth-otp-meta__timer {
  font-weight: 600;
  color: var(--be-coral);
  font-variant-numeric: tabular-nums;
}

.be-auth-otp-meta__resend {
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--be-coral);
}

.be-auth-resend-form {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

/* Tabs (forgot password) */
.be-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 24px;
  padding: 4px;
  border-radius: 999px;
  background: var(--be-blush);
}

.be-auth-tab {
  display: grid;
  place-items: center;
  height: 40px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--be-ink-60);
}

.be-auth-tab.is-active {
  background: var(--be-white);
  color: var(--be-ink);
  box-shadow: 0 2px 8px rgba(90, 35, 51, 0.08);
}

[data-tab-panel][hidden],
.be-auth-panel[hidden],
.be-otpflow__step[hidden] {
  display: none !important;
}

/* Keypad (mobile) */
.be-auth-keypad {
  margin: 0 calc(var(--be-m-pad, 24px) * -1);
  background: #d1d3d9;
}

.be-auth-keypad[hidden] {
  display: none;
}

.be-auth-keypad__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 6px;
  padding: 8px 6px calc(10px + env(safe-area-inset-bottom, 0px));
}

.be-auth-key {
  display: grid;
  place-items: center;
  align-content: center;
  height: 48px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 0 #898a8d;
  color: #000;
  font-family: -apple-system, "SF Pro Display", var(--be-font-ui);
  font-size: 25px;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.be-auth-key small {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.be-auth-key:active {
  background: #adb3bc;
}

.be-auth-key.is-ghost,
.be-auth-key.is-action {
  background: transparent;
  box-shadow: none;
}

/* Choice cards (role / stage) */
.be-auth-choices {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 28px;
  border: 0;
  padding: 0;
  min-width: 0;
}

.be-auth-choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 88px;
  padding: 12px 24px 12px 12px;
  border-radius: 24px;
  background: rgba(255, 249, 244, 0.4);
  border: 1.5px solid var(--be-line);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}

.be-auth-choice:active {
  transform: scale(0.99);
}

.be-auth-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.be-auth-choice:has(input:checked),
.be-auth-choice.is-selected {
  border-color: var(--be-coral-soft);
  background: var(--be-white);
}

.be-auth-choice:has(input:focus-visible) {
  outline: 2px solid var(--be-coral-soft);
  outline-offset: 2px;
}

.be-auth-choice__img {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  background: #f3ebe4;
}

.be-auth-choice__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.be-auth-choice__title {
  font-size: 14px;
  font-weight: 500;
  line-height: 22px;
  color: var(--be-ink);
}

.be-auth-choice__desc {
  font-size: 12px;
  line-height: 18px;
  color: var(--be-muted);
}

.be-auth-choice__radio {
  position: relative;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--be-maroon);
}

.be-auth-choice:has(input:checked) .be-auth-choice__radio,
.be-auth-choice.is-selected .be-auth-choice__radio {
  border: 0;
  background: var(--be-coral);
}

.be-auth-choice:has(input:checked) .be-auth-choice__radio::after,
.be-auth-choice.is-selected .be-auth-choice__radio::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 5px;
  width: 7px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Avatar (profile step) */
.be-auth-avatar {
  position: relative;
  display: block;
  width: 120px;
  height: 120px;
  margin: 28px auto 0;
  cursor: pointer;
  filter: drop-shadow(0 10px 22px rgba(255, 111, 97, 0.22));
}

.be-auth-avatar__photo {
  position: absolute;
  inset: 9px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--be-blush);
  color: var(--be-maroon);
  font-family: var(--be-font-display);
  font-size: 40px;
  font-weight: 700;
}

.be-auth-avatar__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.be-auth-avatar__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.be-auth-avatar__badge {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--be-coral);
  background: var(--be-canvas);
  color: var(--be-coral);
}

.be-auth-avatar:has(input:focus-visible) .be-auth-avatar__badge {
  outline: 2px solid var(--be-coral-soft);
  outline-offset: 2px;
}

.be-auth-avatar input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.be-auth-center-label {
  margin-top: 28px;
  text-align: center;
  color: var(--be-muted);
  font-weight: 400;
}

/* Date boxes (due date, birthdays) */
.be-auth-date {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.be-auth-date__box {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 60px;
  border-radius: 16px;
  background: var(--be-white);
  border: 1.5px solid var(--be-line);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.be-auth-date__box:focus-within {
  border-color: var(--be-coral-soft);
  box-shadow: 0 0 0 3px rgba(255, 139, 122, 0.18);
}

.be-auth-date__box select {
  width: 100%;
  height: 100%;
  padding: 0 8px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
  text-align-last: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--be-ink);
  cursor: pointer;
  outline: none;
}

.be-auth-date__slash {
  flex: 0 0 12px;
  height: 18px;
  position: relative;
}

.be-auth-date__slash::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 1.5px;
  background: var(--be-maroon);
  border-radius: 1px;
  transform: translate(-50%, -50%) rotate(-75deg);
}

.be-auth-section-label {
  margin: 36px 0 8px;
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--be-ink);
}

/* Counter card ("How many little ones?") */
.be-auth-nest {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 236px;
  padding: 24px;
  overflow: hidden;
  border-radius: 24px;
  background: var(--be-white);
  border: 1.5px solid var(--be-line);
}

.be-auth-nest--soft {
  background: var(--be-canvas);
}

.be-auth-nest__count {
  position: absolute;
  right: 72px;
  top: 50%;
  z-index: 0;
  transform: translateY(-50%);
  font-size: 240px;
  font-weight: 600;
  line-height: 1;
  color: rgba(90, 35, 51, 0.1);
  pointer-events: none;
  user-select: none;
}

.be-auth-nest__btn {
  position: relative;
  z-index: 2;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid var(--be-color-button-inactive, #e7ddd7);
  background: transparent;
  color: var(--be-muted);
}

.be-auth-nest__btn--plus {
  background: #ffe5e0;
  border-color: var(--be-coral);
  color: var(--be-coral);
}

.be-auth-nest__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.be-auth-nest__art {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 188px;
  min-width: 0;
}

.be-auth-nest__art img {
  max-width: 188px;
  max-height: 188px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Kid cards */
.be-auth-kids {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.be-auth-kid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid rgba(122, 31, 61, 0.1);
}

.be-auth-kid[hidden] {
  display: none;
}

/* Floated so the legend sits inside the card instead of cutting its border. */
.be-auth-kid__title {
  float: left;
  width: 100%;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--be-ink);
}

.be-auth-kid .be-field input {
  text-align: center;
  font-weight: 400;
}

/* Progress dots (onboarding) */
.be-auth-progress {
  display: flex;
  gap: 6px;
}

.be-auth-progress span {
  width: 18px;
  height: 4px;
  border-radius: 4px;
  background: var(--be-blush-line);
}

.be-auth-progress span.is-done {
  background: var(--be-coral);
}

/* Welcome message */
.be-auth-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}

.be-auth-welcome__body {
  max-width: 320px;
  font-size: 12px;
  line-height: 18px;
  color: var(--be-muted);
}

.be-auth-welcome__banner {
  width: 100%;
  max-width: 420px;
  height: auto;
}

.be-auth-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 12px;
  color: var(--be-muted);
}

.be-auth-steps__dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--be-blush-line);
  font-size: 12px;
  font-weight: 700;
  color: var(--be-muted);
}

.be-auth-steps__dot.is-current {
  border-color: var(--be-coral);
  background: var(--be-coral);
  color: #fff;
}

.be-auth-steps__dot.is-done {
  border-color: var(--be-color-text-success, #2a8e7d);
  background: var(--be-color-text-success, #2a8e7d);
  color: #fff;
}

.be-auth-steps__label.is-current {
  color: var(--be-ink);
  font-weight: 600;
}

.be-auth-info {
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--be-white);
  border: 1px solid var(--be-line);
  font-size: 13px;
  color: var(--be-ink);
  word-break: break-word;
}

.be-auth-plain-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.be-auth-error--center {
  text-align: center;
}

.be-auth-icon-badge {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--be-blush);
  color: var(--be-coral);
}

.be-auth-info .be-auth-label {
  margin: 0 0 2px;
}

.be-auth-steps {
  list-style: none;
  padding: 0;
}

.be-auth-setup-note {
  margin-top: 20px;
}

.be-auth-switch.be-auth-plain-btn {
  width: 100%;
}

.be-auth-onb-block {
  margin-top: 28px;
}

.be-auth-kid .be-auth-error {
  margin-top: -4px;
}

/* ---------- Mobile (app design) ---------- */
body.be-m.be-auth-screen {
  padding-bottom: 0;
}

.be-m.be-auth-screen .be-mh {
  display: none;
}

.be-auth-m {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--be-canvas);
}

/* No z-index here: a stacking context would stop the polka blending with the canvas. */
.be-auth-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.be-auth-bg__polka {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: min(520px, 62vh);
  background: url("../img/auth/polka.webp") center top / auto 100% repeat-x;
  mix-blend-mode: soft-light;
  opacity: 0.9;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 22%, rgba(0, 0, 0, 0.7) 45%, rgba(0, 0, 0, 0.35) 68%, rgba(0, 0, 0, 0.1) 85%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 22%, rgba(0, 0, 0, 0.7) 45%, rgba(0, 0, 0, 0.35) 68%, rgba(0, 0, 0, 0.1) 85%, transparent 100%);
}

.be-auth-bg__glow {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(100%, 720px);
  height: min(50vh, 480px);
  border-radius: 50%;
  background: var(--be-coral-soft);
  opacity: 0.2;
  transform: translate(-50%, 40%);
}

.be-auth-m__body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--be-m-col, 480px);
  margin: 0 auto;
  padding: env(safe-area-inset-top, 0px) var(--be-m-pad, 24px) 0;
}

.be-auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin-top: 4px;
}

.be-auth-top > :only-child[data-be-auth-skip],
.be-auth-top > .be-auth-skip:last-child:first-child {
  margin-left: auto;
}

.be-auth-icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: -8px;
  border-radius: 50%;
  color: var(--be-maroon);
}

.be-auth-icon-btn[hidden],
.be-auth-skip[hidden] {
  display: none;
}

.be-auth-icon-btn:active {
  background: rgba(90, 35, 51, 0.06);
}

.be-auth-skip {
  margin-left: auto;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--be-coral);
}

.be-auth-m .be-auth-panels,
.be-auth-m .be-auth-panel,
.be-auth-m .be-otpflow,
.be-auth-m .be-otpflow__step,
.be-auth-m .be-auth-form,
.be-auth-m .be-auth-flow {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.be-auth-m .be-auth-copy {
  margin-top: 24px;
}

.be-auth-m .be-auth-copy--left {
  margin-top: 12px;
}

.be-auth-m .be-auth-cta {
  margin-top: auto;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.be-auth-m .be-otpflow.has-keypad-open .be-auth-cta {
  padding-bottom: 12px;
}

.be-auth-m .be-auth-panel[data-auth-panel="forgot"] .be-auth-cta,
.be-auth-m .be-auth-cta--inline {
  margin-top: 0;
  padding-bottom: 0;
}

.be-auth-m .be-auth-cta--tight {
  margin-top: auto;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

/* Mobile welcome screen */
.be-auth-m--welcome .be-auth-welcome {
  flex: 1;
  padding-bottom: 24px;
}

.be-auth-m--welcome .be-auth-welcome > .be-auth-copy,
.be-auth-m--welcome .be-auth-welcome__banner {
  margin-top: auto;
}

/* ---------- Desktop ---------- */
.be-auth-d {
  padding-top: 40px;
  padding-bottom: 80px;
}

.be-auth-d__split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 640px;
  overflow: hidden;
  border-radius: 32px;
  background: var(--be-white);
  border: 1px solid var(--be-line);
  box-shadow: var(--be-shadow-soft);
}

.be-auth-brand {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 56px 56px 40px;
  overflow: hidden;
  background: linear-gradient(160deg, #ffe9e5 0%, #fff4ec 55%, #fff9f4 100%);
}

.be-auth-brand__polka {
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 60%;
  background: url("../img/auth/polka.webp") center top / 420px auto repeat;
  mix-blend-mode: soft-light;
  opacity: 0.7;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent);
  mask-image: linear-gradient(to bottom, #000, transparent);
}

.be-auth-brand__copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 440px;
}

.be-auth-brand__title {
  font-family: var(--be-font-display);
  font-size: 40px;
  font-weight: 600;
  line-height: 48px;
  color: var(--be-ink);
}

.be-auth-brand__title em {
  font-style: italic;
  font-weight: 700;
  color: var(--be-maroon);
}

.be-auth-brand__lead {
  font-size: 14px;
  line-height: 22px;
  color: var(--be-ink-60);
}

.be-auth-brand__art {
  align-self: center;
  width: min(360px, 80%);
  margin-top: auto;
}

.be-auth-brand__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.be-auth-brand__chips li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 500;
  color: var(--be-ink);
}

.be-auth-brand__chips svg {
  color: var(--be-coral);
}

.be-auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px clamp(32px, 5vw, 80px);
}

.be-auth-card > * {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.be-auth-card--single {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px clamp(32px, 5vw, 64px);
  border-radius: 32px;
  background: var(--be-white);
  border: 1px solid var(--be-line);
  box-shadow: var(--be-shadow-soft);
}

.be-auth-card--single > * {
  max-width: none;
}

.be-auth-d .be-auth-keypad {
  display: none;
}

.be-auth-d .be-auth-otp__box {
  height: 64px;
}

.be-auth-d .be-auth-lead {
  font-size: 13px;
  line-height: 20px;
}

.be-auth-d .be-auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.be-auth-d .be-auth-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--be-ink-60);
}

.be-auth-d .be-auth-back:hover {
  color: var(--be-coral);
}

.be-auth-d .be-auth-welcome {
  padding: 24px 0 8px;
}

.be-auth-d .be-auth-head .be-auth-skip {
  margin-left: 0;
  font-size: 13px;
}

.be-auth-d--onboarding .be-auth-cta {
  margin-top: 32px;
}

.be-auth-d--onboarding .be-auth-nest {
  max-width: 420px;
  margin: 0 auto;
}

.be-auth-d--onboarding .be-auth-avatar + .be-auth-error,
.be-auth-d--onboarding .be-auth-center-label + .be-field {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 1023px) {
  .be-auth-d__split {
    grid-template-columns: 1fr;
  }

  .be-auth-brand {
    display: none;
  }
}

/* ---------- OTP sheet (log in to continue) ---------- */
.be-auth-sheet {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.be-auth-sheet[hidden] {
  display: none;
}

.be-auth-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 10, 15, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.be-auth-sheet__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  max-height: min(92vh, 760px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom, 0px));
  border-radius: 24px 24px 0 0;
  background: var(--be-canvas);
  box-shadow: 0 -16px 48px rgba(26, 10, 15, 0.18);
  transform: translateY(110%);
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}

.be-auth-sheet.is-open .be-auth-sheet__backdrop {
  opacity: 1;
}

.be-auth-sheet.is-open .be-auth-sheet__panel {
  transform: translateY(0);
}

.be-auth-sheet__close {
  align-self: flex-end;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #e8ddd4;
  background: var(--be-white);
  color: var(--be-ink);
}

.be-auth-sheet .be-auth-copy {
  margin-top: 0;
}

.be-auth-sheet__message {
  margin: -8px 44px 12px;
  text-align: center;
  font-size: 13px;
  line-height: 20px;
  color: var(--be-ink-60);
}

.be-auth-sheet .be-display {
  font-size: 30px;
  line-height: 38px;
}

.be-auth-sheet .be-auth-keypad {
  margin: 16px -24px calc(-16px - env(safe-area-inset-bottom, 0px));
}

@media (min-width: 768px) {
  .be-auth-sheet {
    align-items: center;
    padding: 24px;
  }

  .be-auth-sheet__panel {
    max-width: 460px;
    padding: 24px 40px 32px;
    border-radius: 28px;
    transform: translateY(24px);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .be-auth-sheet.is-open .be-auth-sheet__panel {
    transform: none;
    opacity: 1;
  }

  .be-auth-sheet .be-auth-keypad {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .be-auth-sheet__panel,
  .be-auth-sheet__backdrop,
  .be-auth-otp.is-shake {
    transition: none;
    animation: none;
  }
}
