/* Client Portal sign-in (2026-10-27). One cream page; a light frame whose cap curves into a navy panel (Login /
   Sign Up switch, underline fields, a wide rounded button). Loaded only by portal/index.html. */

.fm-portal-page { background: var(--fm-cream); }
.fm-portal-page .fm-portal-hero { background: var(--fm-cream); }
.fm-portal-page.is-auth .fm-portal-hero { display: none; }
.fm-portal-page.is-auth .fm-portal { padding-block: clamp(2rem, 1rem + 4vw, 4.5rem) clamp(3rem, 2rem + 4vw, 6rem); }

.fm-auth {
  --auth-r: 44px;
  --auth-ink: #FFF1E4;
  --auth-muted: rgb(255 241 228 / 0.62);
  --auth-line: rgb(255 241 228 / 0.2);
  display: grid; justify-items: center;
}
.fm-auth[hidden] { display: none; }
.fm-auth__frame {
  width: min(100%, 30rem);
  padding: 10px 10px 0;
  border-radius: calc(var(--auth-r) + 10px);
  background: #FFFAF5;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.9) inset, 0 30px 70px -28px rgb(var(--fm-navy-rgb) / 0.35), 0 10px 24px -14px rgb(var(--fm-navy-rgb) / 0.18);
  animation: fm-auth-in 700ms var(--fm-ease) both;
}

/* The cap curves down into the panel on the right, like the reference: its rounded corner shows navy behind it. */
.fm-auth__cap {
  position: relative; z-index: 1;
  padding: 1.75rem 1.5rem 1.6rem;
  border-radius: var(--auth-r) var(--auth-r) var(--auth-r) 0;
  background: #FFFAF5;
  text-align: center;
}
.fm-auth__eyebrow { margin: 0 0 0.5rem; font: 600 0.75rem var(--fm-font-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--fm-blue-ink); }
.fm-auth__title { margin: 0; font-family: var(--fm-font-display); font-weight: 600; font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem); line-height: 1.1; letter-spacing: -0.02em; color: var(--fm-navy); }
.fm-auth__sub { margin: 0.5rem auto 0; max-width: 22rem; font-size: 0.9375rem; line-height: 1.5; color: rgb(var(--fm-navy-rgb) / 0.68); }

.fm-auth__panel {
  position: relative;
  padding: 1.75rem clamp(1.25rem, 0.6rem + 3vw, 2.25rem) 2rem;
  border-radius: var(--auth-r) 0 var(--auth-r) var(--auth-r);
  background:
    radial-gradient(120% 70% at 12% 0%, rgb(var(--fm-violet-rgb) / 0.28), transparent 60%),
    radial-gradient(90% 60% at 100% 100%, rgb(var(--fm-magenta-rgb) / 0.14), transparent 65%),
    linear-gradient(180deg, #161D36 0%, var(--fm-navy) 100%);
  color: var(--auth-ink);
}
.fm-auth__panel::before { /* navy under the cap's rounded corner */
  content: ""; position: absolute; right: 0; top: calc(var(--auth-r) * -1);
  width: var(--auth-r); height: var(--auth-r); background: #161D36;
}

/* Login | Sign Up */
.fm-auth__tabs {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  margin: 0 0 1.75rem; padding: 4px; border-radius: 999px;
  background: rgb(255 241 228 / 0.08); box-shadow: inset 0 0 0 1px rgb(255 241 228 / 0.1);
}
.fm-auth__panel:not([data-step="tabs"]) .fm-auth__tabs { display: none; }
.fm-auth__thumb {
  position: absolute; inset: 4px auto 4px 4px; width: calc(50% - 4px); border-radius: 999px;
  background: var(--auth-ink); box-shadow: 0 6px 18px -8px rgb(0 0 0 / 0.6);
  transition: transform 420ms var(--fm-ease);
}
.fm-auth__tabs[data-active="signup"] .fm-auth__thumb { transform: translateX(100%); }
.fm-auth__tab {
  position: relative; z-index: 1; min-height: 44px; border: 0; border-radius: 999px; background: none;
  font: 600 0.9375rem var(--fm-font-body); color: var(--auth-muted); cursor: pointer;
  transition: color 300ms var(--fm-ease);
}
.fm-auth__tab[aria-selected="true"] { color: var(--fm-navy); }
.fm-auth__tab:not([aria-selected="true"]):hover { color: var(--auth-ink); }

.fm-auth__pane[hidden], .fm-auth__step[hidden] { display: none; }
.fm-auth__pane:not([hidden]), .fm-auth__step:not([hidden]) { animation: fm-auth-pane 360ms var(--fm-ease) both; }
.fm-auth__form { display: grid; gap: 1.35rem; }
.fm-auth__step-title { margin: 0; font-family: var(--fm-font-display); font-weight: 600; font-size: 1.375rem; color: var(--auth-ink); }
.fm-auth__hint { margin: -0.35rem 0 0; font-size: 0.875rem; line-height: 1.55; color: var(--auth-muted); }
.fm-auth__step-title + .fm-auth__hint { margin-top: -0.85rem; }

/* Underline fields */
.fm-auth__field { position: relative; display: grid; gap: 0.35rem; }
.fm-auth__field label { font-weight: 600; font-size: 0.875rem; color: var(--auth-ink); }
.fm-auth__field input {
  width: 100%; min-height: 44px; padding: 0.4rem 0 0.55rem; border: 0; border-radius: 0;
  border-bottom: 1px solid var(--auth-line); background: transparent;
  font: 400 1rem var(--fm-font-body); color: var(--auth-ink); caret-color: #A57BFF;
  transition: border-color 250ms var(--fm-ease);
}
.fm-auth__field input:-webkit-autofill { -webkit-text-fill-color: var(--auth-ink); transition: background-color 9999s 0s; }
.fm-auth__field::after { /* gradient underline grows on focus */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px;
  background: var(--fm-gradient-cta); transform: scaleX(0); transform-origin: left; transition: transform 380ms var(--fm-ease);
}
.fm-auth__field:focus-within::after { transform: scaleX(1); }
.fm-auth__field input:focus { outline: none; }
.fm-auth__field input:focus-visible { outline: none; }
.fm-auth__field input[aria-invalid="true"] { border-bottom-color: #FF7A92; }
.fm-auth__field--password input { padding-right: 2.75rem; }
.fm-auth__code { font-family: var(--fm-font-mono) !important; font-size: 1.25rem !important; letter-spacing: 0.35em; }
.fm-auth__reveal {
  position: absolute; right: -6px; bottom: 2px; display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 12px; background: none; color: var(--auth-muted); cursor: pointer;
}
.fm-auth__reveal:hover { color: var(--auth-ink); }
.fm-auth__eye { width: 20px; height: 20px; }
.fm-auth__reveal[aria-pressed="false"] .fm-auth__eye-off { display: none; }

.fm-auth__row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-top: -0.35rem; }
.fm-auth__switch { position: relative; display: inline-flex; align-items: center; gap: 0.6rem; min-height: 44px; font-size: 0.875rem; font-weight: 500; color: var(--auth-ink); cursor: pointer; }
.fm-auth__switch input { position: absolute; opacity: 0; width: 38px; height: 22px; margin: 0; cursor: pointer; }
.fm-auth__switch-track { position: relative; flex: none; width: 38px; height: 22px; border-radius: 999px; background: rgb(255 241 228 / 0.16); box-shadow: inset 0 0 0 1px rgb(255 241 228 / 0.25); transition: background 300ms var(--fm-ease); }
.fm-auth__switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--auth-ink); transition: transform 300ms var(--fm-ease); }
.fm-auth__switch input:checked + .fm-auth__switch-track { background: var(--fm-gradient-cta); box-shadow: none; }
.fm-auth__switch input:checked + .fm-auth__switch-track::after { transform: translateX(16px); }
.fm-auth__switch input:focus-visible + .fm-auth__switch-track { outline: 2px solid #A57BFF; outline-offset: 3px; }

.fm-auth__link {
  min-height: 44px; padding: 0 2px; border: 0; background: none; font: 600 0.875rem var(--fm-font-body);
  color: #B8CCFF; text-decoration: underline; text-decoration-color: rgb(184 204 255 / 0.4); text-underline-offset: 4px; cursor: pointer;
}
.fm-auth__link:hover { color: #fff; text-decoration-color: currentColor; }
.fm-auth__link--center { justify-self: center; margin-top: -0.6rem; font-weight: 500; }

.fm-auth__submit {
  min-height: 52px; margin-top: 0.4rem; border: 0; border-radius: 16px;
  background: var(--fm-gradient-cta); background-size: 140% 100%; background-position: 0 0;
  font: 700 1rem var(--fm-font-body); color: #fff; cursor: pointer;
  box-shadow: 0 14px 30px -14px rgb(var(--fm-violet-rgb) / 0.85);
  transition: transform 220ms var(--fm-ease), box-shadow 300ms var(--fm-ease), background-position 500ms var(--fm-ease), opacity 200ms;
}
.fm-auth__submit:hover { transform: translateY(-1px); background-position: 100% 0; box-shadow: 0 18px 36px -14px rgb(var(--fm-magenta-rgb) / 0.8); }
.fm-auth__submit:active { transform: translateY(1px) scale(0.99); }
.fm-auth__submit:disabled { opacity: 0.6; cursor: progress; transform: none; }
.fm-auth :is(.fm-auth__tab, .fm-auth__link, .fm-auth__submit, .fm-auth__reveal, .fm-auth__google-btn):focus-visible { outline: 2px solid #A57BFF; outline-offset: 3px; }

.fm-auth__message { margin: 1rem 0 0; font-size: 0.875rem; line-height: 1.5; color: #FFD3DB; }
.fm-auth__message:empty { display: none; }
.fm-auth__message[data-tone="ok"] { color: #BDEBD0; }

.fm-auth__google[hidden], .fm-auth__panel:not([data-step="tabs"]) .fm-auth__google { display: none; }
.fm-auth__or { display: flex; align-items: center; gap: 0.85rem; margin: 1.5rem 0 1.1rem; font-size: 0.8125rem; color: var(--auth-muted); }
.fm-auth__or::before, .fm-auth__or::after { content: ""; flex: 1; height: 1px; background: var(--auth-line); }
.fm-auth__google-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.7rem; width: 100%; min-height: 50px;
  border: 1px solid rgb(255 241 228 / 0.22); border-radius: 16px; background: rgb(255 241 228 / 0.04);
  font: 600 0.9375rem var(--fm-font-body); color: var(--auth-ink); cursor: pointer;
  transition: background 250ms var(--fm-ease), border-color 250ms var(--fm-ease);
}
.fm-auth__google-btn svg { width: 18px; height: 18px; }
.fm-auth__google-btn:hover { background: rgb(255 241 228 / 0.1); border-color: rgb(255 241 228 / 0.4); }

.fm-auth__foot { margin: 0; padding: 1.15rem 1rem 1.3rem; text-align: center; font-size: 0.875rem; color: rgb(var(--fm-navy-rgb) / 0.7); }
.fm-auth__foot a { font-weight: 600; color: var(--fm-blue-ink); text-underline-offset: 3px; }

.fm-auth__perks { display: none; }

/* Desktop: a wide two-column frame. The brand side sits on cream at the left; the navy panel on the right keeps the
   dramatic curve (its top-left corner sweeps into the cream like the reference's curved edge). */
@media (min-width: 900px) {
  .fm-portal-page.is-auth .fm-portal .fm-container { max-width: 72rem; }
  .fm-auth { --auth-r: 56px; }
  .fm-auth__frame {
    width: min(100%, 68rem); padding: 14px;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 30rem);
    grid-template-areas: "cap panel" "foot panel";
    grid-template-rows: 1fr auto;
    border-radius: calc(var(--auth-r) + 14px);
  }
  .fm-auth__cap {
    grid-area: cap; align-self: center; text-align: left;
    padding: 3.5rem clamp(2rem, 1rem + 3vw, 4rem) 1rem; border-radius: 0; background: none;
  }
  .fm-auth__eyebrow { margin-bottom: 1rem; }
  .fm-auth__title { font-size: clamp(2.5rem, 1.6rem + 2vw, 3.5rem); line-height: 1.04; letter-spacing: -0.03em; }
  .fm-auth__sub { margin: 1rem 0 0; max-width: 26rem; font-size: 1.0625rem; }
  .fm-auth__perks { display: grid; gap: 1.1rem; margin: 2.5rem 0 0; padding: 0; list-style: none; max-width: 26rem; }
  .fm-auth__perks li { position: relative; display: grid; gap: 0.15rem; padding-left: 2.1rem; }
  .fm-auth__perks li::before {
    content: ""; position: absolute; left: 0; top: 0.2rem; width: 1.25rem; height: 1.25rem; border-radius: 50%;
    background: var(--fm-gradient-cta); box-shadow: 0 6px 14px -6px rgb(var(--fm-violet-rgb) / 0.8);
  }
  .fm-auth__perks li::after { /* check mark */
    content: ""; position: absolute; left: 0.42rem; top: 0.42rem; width: 0.3rem; height: 0.55rem;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
  }
  .fm-auth__perks strong { font-size: 0.9375rem; color: var(--fm-navy); }
  .fm-auth__perks span { font-size: 0.875rem; line-height: 1.5; color: rgb(var(--fm-navy-rgb) / 0.66); }
  .fm-auth__panel {
    grid-area: panel; align-self: stretch; display: flex; flex-direction: column; justify-content: center;
    padding: 2.75rem 2.75rem 2.5rem; min-height: 38rem;
    border-radius: calc(var(--auth-r) * 2) var(--auth-r) var(--auth-r) var(--auth-r);
  }
  .fm-auth__panel::before { display: none; }
  .fm-auth__foot { grid-area: foot; text-align: left; padding: 0 clamp(2rem, 1rem + 3vw, 4rem) 2.5rem; }
}

@keyframes fm-auth-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes fm-auth-pane { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 559px) {
  .fm-portal-page.is-auth .fm-portal { padding-block: 1rem 2.5rem; }
  .fm-portal-page.is-auth .fm-portal .fm-container { padding-inline: 12px; }
  .fm-auth { --auth-r: 36px; }
  .fm-auth__frame { padding: 8px 8px 0; border-radius: calc(var(--auth-r) + 8px); }
  .fm-auth__cap { padding: 1.4rem 1rem 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .fm-auth__frame, .fm-auth__pane:not([hidden]), .fm-auth__step:not([hidden]) { animation: none; }
  .fm-auth__thumb, .fm-auth__field::after, .fm-auth__submit, .fm-auth__switch-track, .fm-auth__switch-track::after { transition: none; }
  .fm-auth__submit:hover, .fm-auth__submit:active { transform: none; }
}

/* Your team (2026-11-03): one row per person, actions wrap under the name on a phone. */
.fm-portal-team h2, .fm-portal-team h3, .fm-portal-team p { margin: 0; }
.fm-portal-team__list { list-style: none; margin: 0; padding: 0; display: grid; }
.fm-portal-team__list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--fm-space-2) var(--fm-space-4); padding: var(--fm-space-3) 0; border-top: 1px solid var(--fm-border); }
.fm-portal-team__list li:first-child { border-top: 0; }
.fm-portal-team__who { display: grid; gap: 2px; min-width: 0; }
.fm-portal-team__who strong, .fm-portal-team__who span { overflow-wrap: anywhere; }
.fm-portal-team__who span { font-size: var(--fm-text-sm); }
.fm-portal-team__actions { display: flex; flex-wrap: wrap; gap: var(--fm-space-4); }
.fm-portal-team .fm-btn { justify-self: start; }
