/* ==========================================================================
   Membership pages (templates/membership/*, which extend layouts/base.hubl.html):
   sign in, register, password reset, "check your email".

   Builds on css/bank-onboarding.css, which the layout loads first: the
   .bo-page base (Aritma Uten, colours, focus ring), .bo-header and
   .bo-button. Marketing kit rules: regular weight only, hierarchy from size
   and colour, spacing 4/8/16/24/32/48/64, 5 px controls and 10 px cards, no
   left-border accents, no arrows in buttons or links, pink never as text on
   a light surface, red only in illustrations, one loud element per screen
   (the blue submit button).

   The forms are HubSpot's own markup (member_login, member_register,
   password_reset_request, password_reset). main.css styles those widgets
   site-wide from inside Tailwind's cascade layers, so plain rules here
   already beat it, except its !important ones (the show-password eye icon
   keeps main.css's look). Every rule starts with .bo-page.mem to stay on
   these pages and to beat HubSpot's own unlayered widget CSS. !important is
   used only against HubSpot's !important red error border and the inline
   styles the password prompt module puts on its field.
   ========================================================================== */

/* --- Frame --------------------------------------------------------------- */

.mem__inner {
  box-sizing: border-box;
  width: 100%;
  max-width: 512px;
  margin: 0 auto;
  padding: var(--bo-space-7) var(--bo-space-3) var(--bo-space-6);
}
.bo-page.mem {
  min-height: calc(100vh - 160px);
}

.mem-card {
  background: var(--bo-white);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius-md);
  padding: var(--bo-space-6);
}

/* One-line footer on the page background (.bo-page supplies the tokens) */
.mem-footer {
  color: var(--bo-indigo-70);
  font-size: 14px;
  line-height: 20px;
  padding: var(--bo-space-4) 0 var(--bo-space-5);
}
.mem-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--bo-space-2) var(--bo-space-4);
}
.mem-footer p {
  margin: 0;
}
.mem-footer ul {
  display: flex;
  gap: var(--bo-space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}
.mem-footer a {
  color: var(--bo-indigo-70);
  text-decoration: none;
}
.mem-footer a:hover {
  text-decoration: underline;
}
.mem-footer :focus-visible {
  outline: 2px solid var(--bo-blue);
  outline-offset: 2px;
}
/* page_footer repeats the copyright line */
body:has(.mem-footer)
  .hs_cos_wrapper_type_page_footer
  .hs-footer-company-copyright {
  display: none;
}

/* --- Text ---------------------------------------------------------------- */

.bo-page.mem p,
.bo-page.mem ul {
  margin: 0;
}
/* One step below the kit's h2, so most titles fit one line in the card. */
.bo-page.mem .mem-title {
  margin: 0 0 var(--bo-space-3);
  font-size: 34px;
  line-height: 40px;
  font-weight: 400;
  color: var(--bo-indigo);
  text-wrap: pretty;
}
.bo-page.mem .mem-lead {
  font-size: 18px;
  line-height: 28px;
  color: var(--bo-indigo);
}
.bo-page.mem .mem-muted {
  margin-top: var(--bo-space-3);
  color: var(--bo-indigo-70);
}
.bo-page.mem .mem-small {
  font-size: 14px;
  line-height: 20px;
  color: var(--bo-indigo-70);
}
.bo-page.mem .mem-email {
  overflow-wrap: anywhere;
}
.bo-page.mem a {
  color: var(--bo-blue);
  text-decoration: underline;
  font-weight: 400;
}
.bo-page.mem a:hover {
  color: var(--bo-blue);
  text-decoration: none;
}
.bo-page.mem .hs_cos_wrapper_type_rich_text {
  display: block;
}

/* "Need help?" under the card */
.bo-page.mem .mem-help {
  margin-top: var(--bo-space-4);
  text-align: center;
  font-size: 14px;
  line-height: 20px;
  color: var(--bo-indigo-70);
}

/* The quiet second way in, under a full-width hairline */
.bo-page.mem .mem-alt-link {
  margin-top: var(--bo-space-5);
  padding-top: var(--bo-space-4);
  border-top: 1px solid var(--bo-border);
}

.bo-page.mem .mem-actions {
  margin-top: var(--bo-space-5);
}
/* Magic link interstitial: why the extra click */
.bo-page.mem .mem-why {
  margin-top: var(--bo-space-4);
}
/* The address to check: a small label, then the address on its own line,
   never broken in the middle. */
.bo-page.mem .mem-sent__label {
  display: block;
  font-size: 14px;
  line-height: 20px;
  color: var(--bo-indigo-70);
}
.bo-page.mem .mem-email--line {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bo-page.mem .mem-lead--next {
  margin-top: var(--bo-space-3);
}
/* Register: the emailed link as its own line before the password form */
.bo-page.mem .mem-fork {
  margin: var(--bo-space-2) 0 0;
  font-size: 18px;
  line-height: 28px;
}
.bo-page.mem .mem-fork + .mem-muted {
  margin-bottom: var(--bo-space-4);
}
/* Small links under the hairline, one per line */
.bo-page.mem .mem-alt-link + .mem-small {
  margin-top: var(--bo-space-2);
}
/* A second action next to the one blue button */
.bo-page.mem a.mem-button--secondary {
  background: var(--bo-white);
  color: var(--bo-indigo) !important;
  border: 1px solid var(--bo-border);
}
.bo-page.mem [hidden] {
  display: none;
}
.bo-page.mem a.mem-button {
  display: block;
  width: 100%;
  box-sizing: border-box;
  color: var(--bo-white);
  text-decoration: none;
}
.bo-page.mem a.mem-button:hover {
  text-decoration: underline;
}

/* --- HubSpot forms --------------------------------------------------------- */

.bo-page.mem form {
  display: flex;
  flex-direction: column;
  gap: var(--bo-space-4);
  max-width: none;
  margin: var(--bo-space-5) 0 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}
.bo-page.mem .hs-form-field {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  position: relative;
}

/* Labels */
.bo-page.mem .hs-form-field > label {
  display: block;
  margin: 0 0 var(--bo-space-2);
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: var(--bo-indigo);
}

/* Text inputs */
.bo-page.mem .hs-form-field input.hs-input:not([type='checkbox']),
.bo-page.mem .hs-form-field input[type='email'],
.bo-page.mem .hs-form-field input[type='password'],
.bo-page.mem .hs-form-field input[type='text'] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  height: 48px;
  padding: 11px var(--bo-space-3);
  font-family: inherit;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: var(--bo-indigo);
  background: var(--bo-white);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius-sm);
  box-shadow: none;
  transition: none;
}
.bo-page.mem .hs-form-field input::placeholder {
  color: var(--bo-indigo-70);
  opacity: 1;
}
.bo-page.mem .hs-form-field input.hs-input:focus {
  border-color: var(--bo-blue);
  box-shadow: 0 0 0 1px var(--bo-blue);
  outline: none;
}
.bo-page.mem .hs-form-field input[type='password'],
.bo-page.mem .hs-form-field input[type='text'][id*='password'] {
  padding-right: var(--bo-space-6);
}

/* Checkboxes: consent and "Remember me" */
.bo-page.mem .hs-form-field:has(> input[type='checkbox']) {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  column-gap: var(--bo-space-2);
}
.bo-page.mem .hs-form-field:has(> input[type='checkbox']) > p {
  grid-column: 1 / -1;
  margin-bottom: var(--bo-space-3);
  font-size: 14px;
  line-height: 20px;
  color: var(--bo-indigo-70);
  font-style: normal;
}
.bo-page.mem .hs-form-field input[type='checkbox'] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--bo-blue);
  border-radius: 3px;
}
.bo-page.mem .hs-form-field input[type='checkbox'] + label {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--bo-indigo);
  cursor: pointer;
}

/* Submit buttons: one shape. The first action on each page is blue. */
.bo-page.mem .hs_submit,
.bo-page.mem .hs_submit .actions {
  display: block;
  margin: 0;
}
.bo-page.mem input[type='submit'],
.bo-page.mem .hs-button {
  display: block;
  width: 100%;
  margin: 0;
  padding: var(--bo-space-3) var(--bo-space-4);
  font-family: inherit;
  font-size: 16px;
  line-height: 26px;
  font-weight: 400;
  color: var(--bo-white);
  background: var(--bo-blue);
  border: 0;
  border-radius: var(--bo-radius-sm);
  box-shadow: none;
  cursor: pointer;
  transition: none;
}
.bo-page.mem input[type='submit']:hover:not(:disabled),
.bo-page.mem .hs-button:hover:not(:disabled) {
  background: var(--bo-blue);
  text-decoration: underline;
}
/* Disabled until the consent box is ticked (HubSpot's own script). The
   button keeps its colour so the main path never looks broken; the consent
   field says what is missing. */
.bo-page.mem input[type='submit']:disabled {
  background: var(--bo-blue);
  color: var(--bo-white);
  opacity: 1;
  cursor: not-allowed;
}
.bo-page.mem
  .hs-form-field:has(> input[name='explicit_consent']:not(:checked))::after {
  content: 'Tick the box to continue.';
  grid-column: 1 / -1;
  order: 2;
  margin-top: var(--bo-space-1);
  font-size: 14px;
  line-height: 20px;
  color: var(--bo-indigo-70);
}

/* Password rules under the password field */
.bo-page.mem #hs-membership-password-requirements {
  margin: calc(var(--bo-space-2) * -1) 0 0;
  text-align: left;
}
/* Helper text, not an error: no warning mark before anything is typed. */
.bo-page.mem #hs-membership-password-requirements label {
  padding-left: 0;
  background: none;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: var(--bo-indigo-70);
}

/* --- Errors and messages ---------------------------------------------------
   No red: the kit keeps red for illustrations. Errors are indigo text with
   a warning mark, and a field in error gets a 2 px indigo border. */

.bo-page.mem .hs-error-msgs {
  margin: var(--bo-space-2) 0 0;
  padding: 0;
  list-style: none;
}
.bo-page.mem .hs-error-msg {
  display: block;
  margin: 0;
  padding-left: 24px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: var(--bo-indigo);
  background: no-repeat left 2px / 16px 16px
    url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3ccircle cx='8' cy='8' r='7.25' fill='none' stroke='%2345095A' stroke-width='1.5'/%3e%3cpath d='M8 4.5v4.25' stroke='%2345095A' stroke-width='1.5' stroke-linecap='round'/%3e%3ccircle cx='8' cy='11.25' r='.9' fill='%2345095A'/%3e%3c/svg%3e");
}
.bo-page.mem .hs-error-msg:empty {
  display: none;
}
.bo-page.mem input[aria-invalid='true'],
.bo-page.mem .hs-form-field input.form-input-error {
  border: 1px solid var(--bo-indigo) !important;
  box-shadow: 0 0 0 1px var(--bo-indigo);
  margin-bottom: 0 !important;
}
.bo-page.mem .form-input-validation-message-error label {
  color: var(--bo-indigo);
}

/* Page-level error and message boxes (global error, reset sent). Hidden
   while HubSpot leaves them empty. */
.bo-page.mem .hs-form-field:has(.hs-membership-global-error:empty),
.bo-page.mem .hs-form-field:has(.hs-membership-global-message:empty) {
  display: none;
}
.bo-page.mem .hs-form-field:has(.hs-membership-global-error),
.bo-page.mem .hs-form-field:has(.hs-membership-global-message) {
  margin: var(--bo-space-4) 0 0;
  padding: var(--bo-space-3);
  background: var(--bo-card-alt);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius-sm);
}
.bo-page.mem .hs-form-field .hs-membership-global-error,
.bo-page.mem .hs-form-field .hs-membership-global-message {
  display: block;
  margin: 0;
  text-align: left;
  font-size: 16px;
  line-height: 26px;
  color: var(--bo-indigo);
}
.bo-page.mem .hs-form-field:has(.hs-membership-global-error) ul,
.bo-page.mem .hs-form-field:has(.hs-membership-global-message) ul {
  margin: 0;
  text-align: left !important;
}
.bo-page.mem .form-floating-alert-wrapper {
  display: none;
}

/* --- Sign in page ---------------------------------------------------------- */

/* HubSpot's "Try going password-less" paragraph: the page heading says it. */
.bo-page.mem #hs-membership-passwordless-auth-form > div:not([class]):has(> p) {
  display: none;
}
.bo-page.mem .form-separator {
  display: none;
}

/* "Sign in with a password instead": a native disclosure under a hairline.
   Open, it replaces the emailed-link form: one method at a time, with its
   own lead, one blue button and the way back at the bottom. */
.bo-page.mem .mem-alt {
  margin-top: var(--bo-space-5);
  padding-top: var(--bo-space-4);
  border-top: 1px solid var(--bo-border);
}
.bo-page.mem .mem-card:has(.mem-alt[open]) .mem-passwordless,
.bo-page.mem .mem-card:has(.mem-alt[open]) [data-mem-lead] {
  display: none;
}
.bo-page.mem .mem-alt[open] {
  display: flex;
  flex-direction: column;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.bo-page.mem .mem-alt__lead {
  display: none;
}
.bo-page.mem .mem-alt[open] .mem-alt__lead {
  display: block;
  order: -1;
  margin-bottom: var(--bo-space-4);
  font-size: 18px;
  line-height: 28px;
}
.bo-page.mem .mem-alt__open,
.bo-page.mem .mem-alt[open] .mem-alt__closed {
  display: none;
}
.bo-page.mem .mem-alt[open] .mem-alt__open {
  display: inline;
}
.bo-page.mem .mem-alt > summary {
  display: inline-block;
  font-size: 16px;
  line-height: 26px;
  color: var(--bo-blue);
  text-decoration: underline;
  cursor: pointer;
  list-style: none;
}
.bo-page.mem .mem-alt > summary::-webkit-details-marker {
  display: none;
}
.bo-page.mem .mem-alt > summary:hover {
  text-decoration: none;
}
.bo-page.mem .mem-alt[open] > summary {
  order: 2;
  margin-top: var(--bo-space-5);
  padding-top: var(--bo-space-4);
  border-top: 1px solid var(--bo-border);
}
.bo-page.mem .mem-alt form {
  margin-top: var(--bo-space-4);
}
.bo-page.mem .mem-alt[open] form {
  margin-top: 0;
}

/* Forgot password? */
.bo-page.mem #hs_login_reset {
  display: inline-block;
  margin: 0;
  font-size: 14px;
  line-height: 20px;
}

/* Register link: HubSpot renders it in the server markup, so it shows
   without JavaScript. Once the script has split the page into the link
   form and the password view (data-mem-split), it is for people without
   an invitation and shows only with the password route. */
.bo-page.mem .mem-card[data-mem-split] #hs-login-self-registration-link {
  display: none;
}
.bo-page.mem
  .mem-card[data-mem-split]:has(.mem-alt[open])
  #hs-login-self-registration-link {
  display: block;
}
.bo-page.mem #hs-login-self-registration-link {
  margin-top: var(--bo-space-4);
  font-size: 14px;
  line-height: 20px;
  color: var(--bo-indigo-70);
  text-align: left;
  border: 0;
  padding: 0;
}
.bo-page.mem #hs-login-self-registration-link a {
  font-weight: 400;
}

/* "Check your email": resend module */
.bo-page.mem .mem-resend {
  margin-top: var(--bo-space-4);
}
.bo-page.mem .mem-resend form {
  margin: 0;
}
.bo-page.mem .mem-resend button,
.bo-page.mem .mem-resend input[type='submit'],
.bo-page.mem .mem-resend a.hs-button {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: var(--bo-space-3) var(--bo-space-4);
  font-family: inherit;
  font-size: 16px;
  line-height: 26px;
  font-weight: 400;
  text-align: center;
  text-decoration: none;
  color: var(--bo-white);
  background: var(--bo-blue);
  border: 0;
  border-radius: var(--bo-radius-sm);
  cursor: pointer;
}

/* "Check your email": HubSpot's message after "send a new link" */
.bo-page.mem .mem-resend [class*='alert-content'] {
  margin-top: var(--bo-space-3);
  padding: var(--bo-space-3);
  background: var(--bo-card-alt);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius-sm);
  color: var(--bo-indigo);
}

/* Password prompt (templates/system/password-prompt.hubl.html). HubSpot's
   module sets inline styles on the field, hence the !important. */
.bo-page.mem .mem-password-prompt {
  margin-top: var(--bo-space-5);
}
.bo-page.mem .mem-password-prompt > label {
  display: block;
  margin: 0 0 var(--bo-space-2);
  font-size: 14px;
  line-height: 20px;
  color: var(--bo-indigo);
}
.bo-page.mem .mem-password-prompt form {
  margin: 0;
  gap: var(--bo-space-4);
}
.bo-page.mem .mem-password-prompt input[type='password'],
.bo-page.mem .mem-password-prompt input[type='text'] {
  display: block;
  width: 100% !important;
  box-sizing: border-box;
  height: 48px !important;
  margin: 0 !important;
  padding: 11px var(--bo-space-3) !important;
  font-family: inherit;
  font-size: 16px;
  line-height: 24px;
  color: var(--bo-indigo);
  background: var(--bo-white);
  border: 1px solid var(--bo-border) !important;
  border-radius: var(--bo-radius-sm) !important;
  box-shadow: none !important;
}
.bo-page.mem .mem-password-prompt input[type='password']:focus {
  border-color: var(--bo-blue) !important;
  box-shadow: 0 0 0 1px var(--bo-blue) !important;
  outline: none;
}
.bo-page.mem .mem-password-prompt button[type='submit'] {
  display: block;
  width: 100%;
  margin: 0;
  padding: var(--bo-space-3) var(--bo-space-4);
  font-family: inherit;
  font-size: 16px;
  line-height: 26px;
  font-weight: 400;
  color: var(--bo-white);
  background: var(--bo-blue);
  border: 0;
  border-radius: var(--bo-radius-sm);
  cursor: pointer;
}

/* "Check your email": resending is the fallback, not the main action */
.bo-page.mem .mem-resend--secondary button,
.bo-page.mem .mem-resend--secondary input[type='submit'],
.bo-page.mem .mem-resend--secondary a.hs-button {
  background: var(--bo-white);
  color: var(--bo-indigo);
  border: 1px solid var(--bo-border);
}

/* Register: HubSpot's tracking notice is fine print under the consent box */
.bo-page.mem .hs-form-field:has(#hs-register-widget-explicit-consent) > p {
  order: 4;
  grid-column: 1 / -1;
  margin: var(--bo-space-2) 0 0;
  font-size: 13px;
  line-height: 20px;
  color: var(--bo-indigo-70);
}

/* --- Small screens --------------------------------------------------------- */

@media (max-width: 640px) {
  .mem__inner {
    padding: var(--bo-space-5) var(--bo-space-3) var(--bo-space-5);
  }
  .mem-card {
    padding: var(--bo-space-5) var(--bo-space-4);
  }
  .bo-page.mem .mem-title {
    font-size: 34px;
    line-height: 40px;
  }
  .mem-footer__inner {
    flex-direction: column;
  }
}
