/* SASPOL · opt-in login presentation. Existing open/form/message states remain authoritative. */
:is(.auth-ov, .auth-overlay).auth-refined {
  --auth-accent: var(--brand-primary, #1b2e6e);
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 28, 44, .52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #17243b;
  font-family: 'Barlow', system-ui, -apple-system, sans-serif;
  overscroll-behavior: contain;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-mod, .auth-box) {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 480px;
  min-width: 0;
  max-height: 90vh;
  max-height: 90dvh;
  margin: 0;
  padding: 32px;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-block: 20px;
  border: 1px solid #e1e6ed;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 62px rgba(15, 23, 42, .15);
  color: #17243b;
  -webkit-font-smoothing: antialiased;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-mod, .auth-box) * {
  box-sizing: border-box;
}

:is(.auth-ov, .auth-overlay).auth-refined .auth-refined-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 42px;
  margin: 0 0 25px;
  padding: 0 56px 24px 0;
  border-bottom: 1px solid #e9ecf1;
  color: var(--auth-accent);
  text-align: left;
}

:is(.auth-ov, .auth-overlay).auth-refined .auth-refined-brand > :is(svg, img) {
  display: block;
  flex: 0 0 32px;
  width: 32px;
  height: 42px;
  object-fit: contain;
}

:is(.auth-ov, .auth-overlay).auth-refined .auth-refined-brand > svg {
  fill: currentColor;
}

:is(.auth-ov, .auth-overlay).auth-refined .auth-refined-brand > div {
  min-width: 0;
}

:is(.auth-ov, .auth-overlay).auth-refined .auth-refined-wordmark {
  display: block;
  color: var(--auth-accent);
  font: 700 20px/1.15 'Barlow', system-ui, sans-serif;
  letter-spacing: .12em;
}

:is(.auth-ov, .auth-overlay).auth-refined .auth-refined-academy {
  display: block;
  margin-top: 5px;
  color: #697386;
  font: 500 12px/1.4 'Barlow', system-ui, sans-serif;
  letter-spacing: normal;
  text-transform: none;
  overflow-wrap: break-word;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-x, .auth-close-x) {
  position: absolute;
  top: 27px;
  right: 25px;
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid #e1e6ed;
  border-radius: 50%;
  background: #fff;
  box-shadow: none;
  color: #687487;
  font: 400 20px/1 'Barlow', system-ui, sans-serif;
  cursor: pointer;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-x, .auth-close-x) svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-x, .auth-close-x):hover {
  background: #f5f7fa;
  color: #17243b;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-refined-heading, .auth-title) {
  margin: 0 0 9px;
  padding: 0;
  color: #17243b;
  font: 650 27px/1.2 'Barlow', system-ui, sans-serif;
  letter-spacing: -.025em;
  text-transform: none;
  text-align: left;
  overflow-wrap: break-word;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-refined-lead, .auth-sub) {
  margin: 0 0 25px;
  color: #657185;
  font: 400 14px/1.6 'Barlow', system-ui, sans-serif;
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
}

/* The original tabs and handlers remain in the DOM while registration is closed. */
:is(.auth-ov, .auth-overlay).auth-refined .auth-tabs[hidden] {
  display: none !important;
}

:is(.auth-ov, .auth-overlay).auth-refined .auth-form {
  gap: 17px;
}

:is(.auth-ov, .auth-overlay).auth-refined .auth-field {
  min-width: 0;
  gap: 7px;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-lbl, .auth-label) {
  margin: 0;
  color: #3d4a60;
  font: 500 13px/1.4 'Barlow', system-ui, sans-serif;
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-inp, .auth-input) {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  height: 48px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #d9e0e8;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  color: #243147;
  font: 400 16px/1.4 'Barlow', system-ui, sans-serif;
  letter-spacing: normal;
  scroll-margin-block: 20px;
  transition: border-color .15s ease;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-inp, .auth-input)::placeholder {
  color: #8a95a5;
  opacity: 1;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-inp, .auth-input):focus {
  border-color: var(--auth-accent);
  outline: 2px solid var(--auth-accent);
  outline-offset: 1px;
  box-shadow: none;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-btn, .btn-auth) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin-top: 5px;
  padding: 13px 16px;
  border: 1px solid var(--auth-accent);
  border-radius: 9px;
  background: var(--auth-accent);
  box-shadow: none;
  color: #fff;
  font: 600 15px/1.35 'Barlow', system-ui, sans-serif;
  letter-spacing: normal;
  text-transform: none;
  text-align: center;
  white-space: normal;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-btn, .btn-auth):hover:not(:disabled):not([aria-disabled="true"]) {
  background: color-mix(in srgb, var(--auth-accent) 90%, #000);
  border-color: color-mix(in srgb, var(--auth-accent) 90%, #000);
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-btn, .btn-auth):is(:disabled, [aria-disabled="true"]) {
  opacity: .6;
  cursor: not-allowed;
  box-shadow: none;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-err, .auth-error, .auth-ok, .auth-success) {
  margin: 0;
  padding: 11px 13px;
  border-width: 1px;
  border-radius: 8px;
  box-shadow: none;
  font: 400 13px/1.5 'Barlow', system-ui, sans-serif;
  text-align: left;
  overflow-wrap: anywhere;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-mod, .auth-box) > :is(.auth-err, .auth-error, .auth-ok, .auth-success) {
  margin-bottom: 16px;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-err, .auth-error) {
  background: #fff5f4;
  border-color: #efd1ce;
  color: #9f2f2f;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-ok, .auth-success) {
  background: #f3f9f5;
  border-color: #d3e6d9;
  color: #286440;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-foot, .auth-switch) {
  margin-top: 16px;
  color: #6b7586;
  font: 400 13px/1.55 'Barlow', system-ui, sans-serif;
  letter-spacing: normal;
  text-transform: none;
  text-align: center;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-foot, .auth-switch) :is(a, button) {
  color: #59677e;
  font: 500 13px/1.55 'Barlow', system-ui, sans-serif;
  text-transform: none;
  text-decoration: none;
  text-underline-offset: 3px;
  cursor: pointer;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-foot, .auth-switch) :is(a, button):hover {
  color: var(--auth-accent);
  text-decoration: underline;
}

:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-btn, .btn-auth, .auth-x, .auth-close-x):focus-visible,
:is(.auth-ov, .auth-overlay).auth-refined :is(.auth-foot, .auth-switch) :is(a, button):focus-visible {
  outline: 2px solid var(--auth-accent);
  outline-offset: 3px;
  box-shadow: none;
}

@media (max-width: 600px) {
  :is(.auth-ov, .auth-overlay).auth-refined {
    align-items: center;
    padding: 12px;
  }
  :is(.auth-ov, .auth-overlay).auth-refined :is(.auth-mod, .auth-box) {
    max-width: 480px;
    padding: 25px 22px;
    border-radius: 18px;
  }
  :is(.auth-ov, .auth-overlay).auth-refined :is(.auth-x, .auth-close-x) {
    top: 21px;
    right: 18px;
  }
}

@media (max-height: 540px) {
  :is(.auth-ov, .auth-overlay).auth-refined {
    align-items: flex-start;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  :is(.auth-ov, .auth-overlay).auth-refined :is(.auth-mod, .auth-box) {
    max-height: min(90vh, calc(100vh - 24px));
    max-height: min(90dvh, calc(100dvh - 24px));
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(.auth-ov, .auth-overlay).auth-refined :is(.auth-btn, .btn-auth, .auth-inp, .auth-input) {
    transition: none;
  }
}

@media (forced-colors: active) {
  :is(.auth-ov, .auth-overlay).auth-refined :is(.auth-mod, .auth-box, .auth-inp, .auth-input, .auth-x, .auth-close-x) {
    border-color: CanvasText;
  }
  :is(.auth-ov, .auth-overlay).auth-refined :is(.auth-btn, .btn-auth, .auth-x, .auth-close-x, .auth-inp, .auth-input):focus-visible {
    outline-color: Highlight;
  }
}
