/* A restrained, brand-led surface shared by every in-place sign-in entry. */
.fxm-login-modal {
  --fxm-login-purple: #6040be;
  --fxm-login-ink: #23243b;
  box-sizing: border-box;
  width: min(496px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 26px;
  background: #fff;
  color: var(--fxm-login-ink);
  box-shadow: 0 24px 80px rgba(27, 23, 45, .2);
  font-family: inherit;
  scrollbar-width: thin;
}
.fxm-login-modal:not([open]) { display: none; }
.fxm-login-modal::backdrop { background: rgba(32, 35, 49, .38); backdrop-filter: blur(5px); }
.fxm-login-modal *, .fxm-login-modal *::before, .fxm-login-modal *::after { box-sizing: border-box; }
.fxm-login-modal [hidden], .fxm-login-modal .hidden { display: none !important; }
.fxm-login-modal__surface { position: relative; isolation: isolate; padding: 28px 34px 24px; overflow: hidden; }
.fxm-login-modal__watermark { position: absolute; z-index: -1; top: -29px; right: -26px; width: 242px; height: 242px; object-fit: contain; opacity: .72; pointer-events: none; user-select: none; }
.fxm-login-modal__close { position: absolute; top: 20px; right: 20px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: #565466; cursor: pointer; transition: background .16s; }
.fxm-login-modal__close:hover { background: #f2eef9; }
.fxm-login-modal__logo { display: block; width: 143px; height: auto; margin-bottom: 24px; }
.fxm-login-modal__header h2 { margin: 0; font-size: 29px; line-height: 1.25; font-weight: 700; letter-spacing: -.035em; }
.fxm-login-modal__header p { margin: 8px 0 0; color: #828194; font-size: 14px; line-height: 1.55; }
.fxm-login-modal__tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; margin-top: 20px; border: 1px solid #efedf5; border-radius: 14px; background: #f7f7fa; }
.fxm-login-modal__tabs button { min-width: 0; padding: 10px 8px; border: 0; border-radius: 10px; background: transparent; color: #6e6d80; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.35; cursor: pointer; }
.fxm-login-modal__tabs button[aria-selected="true"] { background: #ede8fa; color: var(--fxm-login-purple); }
.fxm-login-modal__form { margin-top: 20px; }
.fxm-login-modal__field + .fxm-login-modal__field { margin-top: 17px; }
.fxm-login-modal__field > label { display: block; margin-bottom: 8px; font-size: 13px; line-height: 1.4; font-weight: 600; }
.fxm-login-modal__input-shell { display: flex; align-items: center; min-height: 49px; padding: 0 13px; gap: 11px; border: 1px solid #dfdbe9; border-radius: 13px; background: #fff; transition: border-color .16s, box-shadow .16s; }
.fxm-login-modal__input-shell:focus-within { border-color: #967dce; box-shadow: 0 0 0 3px rgba(96,64,190,.08); }
.fxm-login-modal__input-shell > svg { flex-shrink: 0; color: #9690a9; }
.fxm-login-modal__input-shell input { width: 100%; min-width: 0; height: 47px; padding: 0; border: 0; outline: 0; background: transparent; box-shadow: none; color: var(--fxm-login-ink); font: inherit; font-size: 14px; }
.fxm-login-modal__input-shell input::placeholder { color: #a09bad; opacity: 1; }
.fxm-login-modal__password-toggle { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 36px; margin-right: -4px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #928ba3; cursor: pointer; }
.fxm-login-modal__send-code { flex-shrink: 0; max-width: 45%; padding: 5px 0 5px 8px; border: 0; border-left: 1px solid #eeebf3; background: transparent; color: var(--fxm-login-purple); font: inherit; font-size: 12px; line-height: 1.4; cursor: pointer; }
.fxm-login-modal__options { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 12px; color: #6b667c; font-size: 12px; line-height: 1.5; }
.fxm-login-modal a { color: var(--fxm-login-purple); text-decoration: none; }
.fxm-login-modal a:hover { text-decoration: underline; text-underline-offset: 3px; }
.fxm-login-modal__submit { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 49px; margin-top: 18px; padding: 10px 20px; border: 0; border-radius: 13px; background: var(--fxm-login-purple); color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .16s; }
.fxm-login-modal__submit:hover { background: #5333ad; }
.fxm-login-modal__submit svg { transition: transform .16s; }
.fxm-login-modal__submit:hover svg { transform: translateX(3px); }
.fxm-login-modal button:disabled { cursor: default; opacity: .55; }
.fxm-login-modal__status { margin: 0; color: #9c4155; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.fxm-login-modal__status:not(:empty) { margin-top: 12px; }
.fxm-login-modal__divider { display: flex; align-items: center; gap: 13px; margin: 18px 0 15px; color: #a19aaa; font-size: 11px; line-height: 1.5; }
.fxm-login-modal__divider::before, .fxm-login-modal__divider::after { content: ''; height: 1px; flex: 1; background: #eeebf2; }
.fxm-login-modal__social { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fxm-login-modal__social > div { min-width: 0; }
.fxm-login-modal__social-button { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 45px; width: 100%; padding: 9px 10px; border: 1px solid #e2ddea; border-radius: 12px; background: #fff; color: #343143; font: inherit; font-size: 14px; cursor: pointer; transition: border-color .16s, background .16s; }
.fxm-login-modal__social-button:hover { border-color: #b9acd4; background: #fcfbfe; }
.fxm-login-modal__social-button svg { width: 20px; height: 20px; flex-shrink: 0; }
.fxm-login-modal__google { position: relative; }
.fxm-login-modal__google:focus-within { outline: 2px solid #967dce; outline-offset: 3px; border-radius: 12px; }
.fxm-login-modal__google-sdk { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 12px; }
.fxm-login-modal__register { margin: 22px 0 0; color: #90889d; text-align: center; font-size: 12px; line-height: 1.6; }
.fxm-login-modal__register a { margin-left: 5px; font-weight: 600; white-space: nowrap; }
.fxm-login-modal button:focus-visible, .fxm-login-modal a:focus-visible, .fxm-login-modal input[type="checkbox"]:focus-visible { outline: 2px solid #967dce; outline-offset: 3px; }
@media (max-width: 540px) {
  .fxm-login-modal { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); border-radius: 22px; }
  .fxm-login-modal__surface { padding: 27px 24px 25px; }
  .fxm-login-modal__logo { width: 135px; margin-bottom: 28px; }
  .fxm-login-modal__header h2 { font-size: 27px; }
  .fxm-login-modal__watermark { top: -14px; right: -35px; width: 220px; height: 220px; }
  .fxm-login-modal__input-shell input { font-size: 16px; }
  .fxm-login-modal__close { top: 18px; right: 16px; }
}
@media (prefers-reduced-motion: reduce) { .fxm-login-modal *, .fxm-login-modal *::before, .fxm-login-modal *::after { transition: none !important; } }

/* Business sign-in uses the same native surface as the standalone auth pages.
 * Desktop rules above and the authentication bridge remain unchanged. */
@media (max-width: 767.98px) {
  dialog.fxm-login-modal[data-fxm-login-modal] {
    --fxm-login-purple: #6040c0;
    --fxm-login-ink: #1c1c21;
    position: fixed; inset: var(--fxm-login-visible-top,0px) 0 auto; width: 100%;
    height: var(--fxm-login-visible-height,100dvh); max-height: none; max-width: none;
    margin: 0; padding: 0; border: 0; border-radius: 0; background: #fff; box-shadow: none;
    font-family: var(--fxm-ios-font,-apple-system,BlinkMacSystemFont,'PingFang SC',sans-serif);
    scrollbar-width: none; overscroll-behavior: contain; scroll-padding-block: calc(68px + env(safe-area-inset-top,0px)) 24px;
  }
  dialog.fxm-login-modal::-webkit-scrollbar { display: none; }
  dialog.fxm-login-modal::backdrop { background: #0004; backdrop-filter: none; }
  dialog.fxm-login-modal .fxm-login-modal__surface { isolation: auto; min-height: 100%; padding: calc(58px + env(safe-area-inset-top,0px)) max(24px,env(safe-area-inset-right,0px)) calc(36px + env(safe-area-inset-bottom,0px)) max(24px,env(safe-area-inset-left,0px)); overflow: visible; }
  dialog.fxm-login-modal .fxm-login-modal__surface::before { content: ''; position: absolute; z-index: -1; inset: 0; background: radial-gradient(ellipse 280px 230px at 100% 0,#6040c01f,transparent 80%); pointer-events: none; }
  dialog.fxm-login-modal .fxm-login-modal__watermark { display: none; }
  dialog.fxm-login-modal .fxm-login-modal__desktop { display: none; }
  dialog.fxm-login-modal .fxm-login-modal__native { display: inline !important; }
  dialog.fxm-login-modal .fxm-login-modal__close { position: fixed; z-index: 12; top: calc(12px + env(safe-area-inset-top,0px)); left: max(18px,env(safe-area-inset-left,0px)); right: auto; width: 44px; height: 44px; min-width: 44px; min-height: 44px; background: transparent; color: #6b7380; }
  dialog.fxm-login-modal .fxm-login-modal__close::before { content: ''; position: absolute; inset: 6px; z-index: -1; border-radius: 50%; background: #f2f3f5; }
  dialog.fxm-login-modal .fxm-login-modal__close svg { width: 16px; height: 16px; }
  dialog.fxm-login-modal .fxm-login-modal__logo { width: min(290px,100%); height: 86px; max-width: 100%; margin: 0 auto 24px; object-fit: contain; }
  dialog.fxm-login-modal .fxm-login-modal__header h2 { margin: 0; font-size: 28px; font-weight: 700; line-height: 1.3; letter-spacing: 0; }
  dialog.fxm-login-modal .fxm-login-modal__header p { margin: 7px 0 0; color: #6b7380; font-size: 14px; line-height: 1.5; }
  dialog.fxm-login-modal .fxm-login-modal__tabs { margin: 24px 0 0; padding: 3px; gap: 0; border: 0; border-radius: 14px; background: #f2f3f5; }
  dialog.fxm-login-modal .fxm-login-modal__tabs button { min-height: 44px; padding: 11px 8px; border-radius: 11px; font-size: 16px; font-weight: 400; line-height: 1.4; color: #6b7380; overflow-wrap: anywhere; }
  dialog.fxm-login-modal .fxm-login-modal__tabs button[aria-selected="true"] { background: #fff; color: var(--fxm-login-purple); font-weight: 600; box-shadow: 0 1px 6px #0000000d; }
  dialog.fxm-login-modal .fxm-login-modal__form { margin-top: 15px; }
  dialog.fxm-login-modal .fxm-login-modal__field + .fxm-login-modal__field { margin-top: 15px; }
  dialog.fxm-login-modal .fxm-login-modal__field > label { margin-bottom: 7px; font-size: 16px; font-weight: 600; line-height: 1.5; }
  dialog.fxm-login-modal .fxm-login-modal__input-shell { min-height: 54px; padding: 0 14px; gap: 11px; border: 1px solid #dedee3; border-radius: 14px; background: #f3f2f8; }
  dialog.fxm-login-modal .fxm-login-modal__input-shell:focus-within { border-color: var(--fxm-login-purple); background: #fff; box-shadow: 0 0 14px #6040c024; }
  dialog.fxm-login-modal .fxm-login-modal__input-shell > svg { width: 20px; height: 20px; color: #8b8b94; }
  dialog.fxm-login-modal .fxm-login-modal__input-shell:focus-within > svg { color: var(--fxm-login-purple); }
  dialog.fxm-login-modal .fxm-login-modal__input-shell:has([data-fxm-login-account]) > svg,dialog.fxm-login-modal .fxm-login-modal__input-shell:has([data-fxm-login-password]) > svg { display: none; }
  dialog.fxm-login-modal .fxm-login-modal__input-shell:has([data-fxm-login-account])::before,dialog.fxm-login-modal .fxm-login-modal__input-shell:has([data-fxm-login-password])::before { content: ''; flex: 0 0 20px; width: 20px; height: 20px; background: #8b8b94; mask: var(--fxm-login-field-icon) center/18px no-repeat; }
  dialog.fxm-login-modal .fxm-login-modal__input-shell:has([data-fxm-login-account]) { --fxm-login-field-icon: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"%3E%3Crect x="3" y="5" width="18" height="14" rx="2"/%3E%3Cpath d="m3 6 9 7 9-7"/%3E%3C/svg%3E'); }
  dialog.fxm-login-modal .fxm-login-modal__input-shell:has([data-fxm-login-password]) { --fxm-login-field-icon: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"%3E%3Crect x="5" y="10" width="14" height="11" rx="2"/%3E%3Cpath d="M8 10V7a4 4 0 0 1 8 0v3M12 14v3"/%3E%3C/svg%3E'); }
  dialog.fxm-login-modal .fxm-login-modal__input-shell:focus-within::before { background: var(--fxm-login-purple); }
  dialog.fxm-login-modal .fxm-login-modal__input-shell:has([aria-invalid="true"]) { border-color: #dc4949; box-shadow: none; }
  dialog.fxm-login-modal .fxm-login-modal__validation { margin: 6px 0 0; color: #dc4949; font-size: 12px; line-height: 1.5; }
  dialog.fxm-login-modal .fxm-login-modal__input-shell input { height: 52px; font-size: 16px; line-height: 1.5; color: var(--fxm-login-ink); }
  dialog.fxm-login-modal .fxm-login-modal__input-shell input::placeholder { color: #9ca3b0; }
  dialog.fxm-login-modal .fxm-login-modal__password-toggle { width: 44px; height: 44px; min-width: 44px; margin-right: -9px; color: #8b8b94; }
  dialog.fxm-login-modal .fxm-login-modal__email-label { display: none !important; }
  dialog.fxm-login-modal:has([data-fxm-login-method="code"][aria-selected="true"]) .fxm-login-modal__account-label { display: none !important; }
  dialog.fxm-login-modal:has([data-fxm-login-method="code"][aria-selected="true"]) .fxm-login-modal__email-label { display: inline !important; }
  dialog.fxm-login-modal .fxm-login-modal__code-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(150px,100%),1fr)); gap: 10px; }
  dialog.fxm-login-modal .fxm-login-modal__code-row > .fxm-login-modal__input-shell { min-width: 0; }
  dialog.fxm-login-modal .fxm-login-modal__code-row > .fxm-login-modal__send-code { max-width: none; min-height: 54px; padding: 10px; border: 1px solid #6040c052; border-radius: 14px; background: #fff; color: var(--fxm-login-purple); font-size: 16px; font-weight: 600; line-height: 1.5; }
  dialog.fxm-login-modal .fxm-login-modal__code-row > .fxm-login-modal__send-code:disabled { border-color: #dedee3; background: #f2f3f5; color: #6b7380; }
  dialog.fxm-login-modal .fxm-login-modal__code-hint { display: block !important; margin: 10px 0 0; color: #6b7380; font-size: 12px; line-height: 1.5; }
  dialog.fxm-login-modal .fxm-login-modal__options { margin-top: 7px; font-size: 14px; }
  dialog.fxm-login-modal .fxm-login-modal__options a { display: inline-flex; align-items: center; min-height: 44px; }
  dialog.fxm-login-modal:has([data-fxm-login-method="code"][aria-selected="true"]) .fxm-login-modal__options { display: none; }
  dialog.fxm-login-modal .fxm-login-modal__submit { min-height: 54px; margin-top: 15px; padding: 12px; border-radius: 16px; background: linear-gradient(115deg,#6f4fd6,#4e2fa6); box-shadow: 0 8px 28px #6040c059; font-size: 18px; font-weight: 600; line-height: 1.4; }
  dialog.fxm-login-modal .fxm-login-modal__submit:disabled { box-shadow: none; }
  dialog.fxm-login-modal .fxm-login-modal__submit svg { display: none; }
  dialog.fxm-login-modal .fxm-login-modal__status { font-size: 14px; line-height: 1.5; }
  dialog.fxm-login-modal .fxm-login-modal__divider { margin: 24px 0; gap: 12px; color: #8b8b94; font-size: 12px; }
  dialog.fxm-login-modal .fxm-login-modal__social { display: flex; flex-direction: column; gap: 12px; }
  dialog.fxm-login-modal .fxm-login-modal__google { order: 2; }
  dialog.fxm-login-modal [data-fxm-apple-signin-host] { order: 1; }
  dialog.fxm-login-modal .fxm-login-modal__social-button { min-height: 52px; border-color: #dedee3; border-radius: 14px; color: var(--fxm-login-ink); font-size: 16px; font-weight: 600; }
  dialog.fxm-login-modal .fxm-login-modal__register { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 6px; margin: 24px 0 0; color: #6b7380; font-size: 14px; line-height: 1.5; }
  dialog.fxm-login-modal .fxm-login-modal__register a { display: inline-flex; align-items: center; min-height: 44px; margin-left: 0; white-space: normal; }
  dialog.fxm-login-modal .fxm-login-modal__native-busy { position: fixed; z-index: 10; inset: 0; align-items: center; justify-content: center; padding: 40px; background: #00000047; }
  dialog.fxm-login-modal[aria-busy="true"] .fxm-login-modal__native-busy { display: flex !important; }
  dialog.fxm-login-modal .fxm-login-modal__native-busy > div { padding: 24px 28px; border-radius: 20px; background: #fff; text-align: center; box-shadow: 0 10px 48px #0003; }
  dialog.fxm-login-modal .fxm-login-modal__native-busy p { margin: 14px 0 0; font-size: 16px; font-weight: 600; line-height: 1.5; }
  dialog.fxm-login-modal .fxm-login-modal__native-busy span { display: block; width: 28px; height: 28px; margin: auto; border: 3px solid #6040c029; border-top-color: #6040c0; border-radius: 50%; animation: fxm-login-native-spin .8s linear infinite; }
  dialog.fxm-login-modal.is-phone-opening { animation: fxm-login-native-enter .22s ease-out both; }
  dialog.fxm-login-modal.is-phone-closing { animation: fxm-login-native-leave .18s ease-in both; pointer-events: none; }
  @keyframes fxm-login-native-enter { from { transform: translateY(36px); opacity: .4; } to { transform: none; opacity: 1; } }
  @keyframes fxm-login-native-leave { from { transform: none; opacity: 1; } to { transform: translateY(30px); opacity: 0; } }
  @keyframes fxm-login-native-spin { to { transform: rotate(360deg); } }
}
@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
  dialog.fxm-login-modal, dialog.fxm-login-modal * { animation: none !important; transition: none !important; }
}
