/* The Lab portal (Fluent Community) in the site's look. Plain CSS, no build: loaded
   in the portal head by inc/community.php, after the site's tokens (--color-*,
   --font-*, --radius-*, read from the built app.css). Colours are never typed here:
   change them in @theme and the portal follows. */

/* Fluent's colour variables, pointed at the site tokens. The portal is always dark. */
html.dark body,
html.dark body .fcom_top_menu,
html.dark body .spaces {
  --fcom-primary-bg: var(--color-panel);
  --fcom-secondary-bg: var(--color-ink);
  --fcom-secondary-content-bg: var(--color-raise);
  --fcom-active-bg: color-mix(in srgb, var(--color-lime) 4%, var(--color-panel));
  --fcom-light-bg: var(--color-raise);
  --fcom-deep-bg: var(--color-fg);
  --fcom-menu-text: var(--color-soft);
  --fcom-menu-text-active: var(--color-fg);
  --fcom-menu-text-hover: var(--color-fg);
  --fcom-menu-bg-hover: var(--color-raise);
  --fcom-primary-text: var(--color-fg);
  --fcom-secondary-text: var(--color-soft);
  --fcom-text-off: var(--color-mute);
  --fcom-text-link: var(--color-lime);
  --fcom-primary-button: var(--color-lime);
  --fcom-primary-button-text: var(--color-on-lime);
  --fcom-primary-border: var(--color-line);
  --fcom-secondary-border: var(--color-line-strong);
  --fcom-highlight-bg: color-mix(in srgb, var(--color-lime) 4%, var(--color-panel));

  /* Element Plus (dialogs, menus, fields, buttons). Primary is lime, with ink on it. */
  --el-color-white: var(--color-ink);
  --el-color-primary: var(--color-lime);
  --el-color-primary-light-3: color-mix(in srgb, var(--color-lime) 70%, var(--color-ink));
  --el-color-primary-light-5: color-mix(in srgb, var(--color-lime) 50%, var(--color-ink));
  --el-color-primary-light-7: color-mix(in srgb, var(--color-lime) 30%, var(--color-ink));
  --el-color-primary-light-8: color-mix(in srgb, var(--color-lime) 20%, var(--color-ink));
  --el-color-primary-light-9: color-mix(in srgb, var(--color-lime) 5%, var(--color-raise));
  --el-color-primary-dark-2: var(--color-lime-dim);
  --el-bg-color: var(--color-panel);
  --el-bg-color-overlay: var(--color-raise);
  --el-bg-color-page: var(--color-ink);
  --el-fill-color-blank: var(--color-panel);
  --el-fill-color-light: var(--color-raise);
  --el-fill-color: var(--color-raise);
  --el-text-color-primary: var(--color-fg);
  --el-text-color-regular: var(--color-soft);
  --el-text-color-secondary: var(--color-mute);
  --el-text-color-placeholder: var(--color-mute);
  --el-border-color: var(--color-line-strong);
  --el-border-color-light: var(--color-line);
  --el-border-color-lighter: var(--color-line);
  --el-border-color-hover: color-mix(in srgb, var(--color-lime) 60%, transparent);
  --el-border-radius-base: var(--radius-xl);
  --el-border-radius-small: var(--radius-lg);
  --el-font-family: var(--font-sans);
}

html.dark body,
html.dark body * {
  font-family: var(--font-sans);
}

html.dark body :is(code, pre, kbd, samp) {
  font-family: var(--font-mono);
}

html.dark body {
  background: var(--color-ink);
  -webkit-font-smoothing: antialiased;
}

html.dark body :is(h1, h2, h3, h4) {
  letter-spacing: -0.02em;
}

/* Dark only: no light/dark switch. */
.fcom_mode_switch {
  display: none !important;
}

/* Header: ink with a hairline, like the site's. */
html.dark body .fcom_top_menu {
  background: color-mix(in srgb, var(--color-ink) 85%, transparent);
  backdrop-filter: blur(24px);
  border-bottom-color: var(--color-line);
}

/* Brand: the site's mark and wordmark, then "Lab" in mono. */
.shader-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-fg);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.shader-brand:hover {
  color: var(--color-lime);
}

.shader-brand-sep {
  margin: 0 0.625rem;
  color: var(--color-line-strong);
}

html.dark body .fhr_logo a {
  text-decoration: none;
}

html.dark body .fhr_logo a span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-lime);
  text-decoration: none;
}

/* "Complete your profile" and other warnings: quiet outline, not coral. */
html.dark body .el-button--danger {
  --el-button-bg-color: transparent;
  --el-button-border-color: var(--color-line-strong);
  --el-button-text-color: var(--color-fg);
  --el-button-hover-bg-color: transparent;
  --el-button-hover-border-color: color-mix(in srgb, var(--color-lime) 60%, transparent);
  --el-button-hover-text-color: var(--color-lime);
}

/* Cards and panels: the site's panel shape. */
html.dark body :is(.fcom_card_sections, .feed_list_item, .app_side_widget, .create_status_holder, .fcom_notice_wrap, .el-card) {
  border-radius: var(--radius-2xl);
}

/* Buttons: 40px, rounded-xl, lime primary with a small lift, like btn-primary.
   Border-box because Fluent's header Login link is `all: unset`, which would add
   its padding on top of the height. */
html.dark body :is(.fcom_primary_button, .el-button) {
  box-sizing: border-box;
  min-height: 2.5rem;
  border-radius: var(--radius-xl);
  font-weight: 600;
}

html.dark body :is(.fcom_primary_button, .el-button--primary) {
  transition: transform 0.15s var(--ease-out);
}

html.dark body :is(.fcom_primary_button, .el-button--primary):hover {
  transform: translateY(-2px);
}

/* In the 52px page bars and the header, buttons are compact and stay put, so
   they keep clear of the bar's edges. */
html.dark body :is(.fhr_content_layout_header, .fcom_top_menu) :is(.fcom_primary_button, .el-button) {
  min-height: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-lg);
}

html.dark body :is(.fhr_content_layout_header, .fcom_top_menu) :is(.fcom_primary_button, .el-button--primary):hover {
  transform: none;
  background-color: var(--color-lime-dim);
  border-color: var(--color-lime-dim);
}

/* Tints: lime stays at about 4% with a faint lime ring, like row-surface on the
   site. Stronger mixes turn olive on near-black. */
html.dark body :is(.fcom_notice_wrap) {
  background: color-mix(in srgb, var(--color-lime) 4%, var(--color-panel));
  border: 1px solid color-mix(in srgb, var(--color-lime) 15%, transparent);
}

html.dark body .router-link-exact-active,
html.dark body :is(.fcom_menu_link, .space_menu_item).active {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-lime) 15%, transparent);
}

/* Popovers (menus, dropdowns): raise with a strong line, like the site's search palette. */
html.dark body {
  --el-popper-bg-color-light: var(--color-raise);
  --el-dropdown-menuItem-hover-fill: color-mix(in srgb, var(--color-lime) 5%, var(--color-raise));
  --el-dropdown-menuItem-hover-color: var(--color-fg);
}

html.dark body .el-popper.is-light {
  border-color: var(--color-line-strong);
  border-radius: var(--radius-xl);
  box-shadow: 0 18px 50px -12px rgb(0 0 0 / 0.8);
}

html.dark body .el-popper.is-light .el-popper__arrow::before {
  background: var(--color-raise);
  border-color: var(--color-line-strong);
}

html.dark body .el-dropdown-menu {
  padding: 4px;
}

html.dark body .el-dropdown-menu__item {
  border-radius: var(--radius-lg);
}

/* The composer opener: an outlined field like form-field, not a filled box. */
html.dark body .create_status_holder .form_placeholder {
  background: transparent;
  border-color: var(--color-line-strong);
  border-radius: var(--radius-xl);
}

html.dark body .create_status_holder .form_placeholder:hover {
  background: transparent;
  border-color: color-mix(in srgb, var(--color-lime) 60%, transparent);
}

/* Fields: like form-field, lime when focused. */
html.dark body :is(.el-input__wrapper, .el-textarea__inner, .el-select__wrapper) {
  border-radius: var(--radius-xl);
  background: var(--color-panel);
}

/* Keyboard focus: the lime ring used across the site. */
html.dark body :is(a, button, [role="button"], [tabindex]):focus-visible {
  outline: 2px solid var(--color-lime);
  outline-offset: 2px;
  border-radius: var(--radius-lg);
}

/* Typing fields keep their own frame; no ring on click. */
html.dark body :is(input, textarea, [contenteditable]):focus-visible {
  outline: none;
}

::selection {
  background: color-mix(in srgb, var(--color-lime) 30%, transparent);
  color: var(--color-fg);
}

/* Icon and text buttons (view switch, dot menus): no filled square on hover, the
   icon turns lime over a faint tint, like btn-icon on the site. */
html.dark body .el-button.is-text:not(.is-disabled):is(:hover, :focus, :active, [aria-expanded="true"]) {
  background-color: color-mix(in srgb, var(--color-lime) 5%, transparent);
  color: var(--color-lime);
}

/* Likes: lime instead of Fluent's red, on posts and comments. */
html.dark body .feed_footer ul li.react_active,
html.dark body .el-icon.user_reacted svg {
  color: var(--color-lime);
}

/* Fluent's red "Pro" tags, as a lime badge. */
html.dark body a.fcom_pro_tag {
  background: var(--color-lime);
  border-color: var(--color-lime);
  color: var(--color-on-lime);
}

/* Every card gets the panel recipe's hairline: panel on ink alone is too faint. */
html.dark body :is(.fcom_feed_box.course_box, .app_side_widget, .create_status_holder, .fcom_dir_layout) {
  border: 1px solid var(--color-line);
  border-radius: var(--radius-2xl);
}

/* Member level badge on avatars: lime, not Fluent's blue. */
html.dark body .fcom_user_level_mark {
  background: var(--color-lime);
  color: var(--color-on-lime);
  border-color: var(--color-ink);
}

/* Login and signup: Fluent's separate "headless" screen (body scope
   user_registration). A quiet brand side and the form on a card, like the
   contact form. Fluent prints the banner colours inline from its settings, so
   those few lines need !important; the portal is always dark. */
html.dark body.fcom_headless_scope_user_registration {
  margin: 0;
  background: var(--color-ink);
  color: var(--color-fg);
  -webkit-font-smoothing: antialiased;
}

html.dark body .fcom_full_layout.fluent_com_auth .fcom_layout_side {
  position: relative;
  justify-content: center;
  padding: 3rem;
  background-color: var(--color-ink) !important;
  background-image: radial-gradient(60% 50% at 30% 70%, color-mix(in srgb, var(--color-lime) 5%, transparent), transparent 70%);
  border-inline-end: 1px solid var(--color-line);
}

html.dark body .fcom_auth_page_row_reverse .fcom_layout_side {
  border-inline-end: 0;
  border-inline-start: 1px solid var(--color-line);
}

html.dark body .fcom_full_layout.fluent_com_auth .fcom_layout_side .fcom_welcome {
  width: 100%;
  max-width: 26rem;
  margin: 0;
  padding: 0;
  text-align: left;
}

/* The Bullseye stands in for a logo until one is set in Fluent's settings. */
html.dark body .fcom_layout_side .fcom_welcome:not(:has(.fcom_logo))::before {
  content: "";
  display: block;
  width: 3rem;
  height: 3rem;
  margin-bottom: 2rem;
  background: url(brand/mark.svg) center / contain no-repeat;
}

html.dark body .fcom_layout_side .fcom_welcome .fcom_logo {
  justify-content: flex-start;
  margin: 0 0 2rem;
}

html.dark body .fcom_full_layout.fluent_com_auth .fcom_layout_side .fcom_welcome h2 {
  margin: 0 0 1rem;
  color: var(--color-fg) !important;
  font-size: var(--text-page);
  line-height: var(--text-page--line-height);
  letter-spacing: var(--text-page--letter-spacing);
  font-weight: 600;
  text-wrap: balance;
}

html.dark body .fcom_layout_side .fcom_sub_title {
  color: var(--color-soft) !important;
}

html.dark body .fcom_full_layout.fluent_com_auth .fcom_layout_side .fcom_welcome p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  text-wrap: pretty;
}

html.dark body .fcom_layout_main {
  padding: 3rem 1.5rem;
  background: var(--color-ink);
}

/* The form on the card recipe's surface. */
html.dark body .fcom_layout_main .fcom_user_onboard {
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  padding: 2.5rem;
  background: var(--color-panel);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-3xl);
}

html.dark body .fcom_layout_main .fcom_onboard_header {
  margin-bottom: 1.75rem;
  text-align: left;
}

html.dark body .fcom_layout_main .fcom_onboard_header h2 {
  margin: 0 0 0.375rem;
  font-size: 1.375rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}

html.dark body .fcom_layout_main .fcom_onboard_header p {
  margin: 0;
  color: var(--color-soft);
  font-size: 0.875rem;
  line-height: 1.5;
}

html.dark body .fcom_user_onboard .fcom_onboard_form {
  padding: 0;
}

html.dark body .fcom_user_onboard .fcom_onboard_form :is(.fcom_form-group, .fs_input_wrap, .fls_login_wrapper) {
  margin: 0 0 1.25rem;
}

/* Labels and fields: the form-label and form-field recipes. */
html.dark body .fcom_user_onboard .fcom_onboard_form :is(.fcom_form-group, .fs_input_wrap) > label {
  display: block;
  margin: 0 0 0.375rem;
  color: var(--color-mute);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.5;
}

html.dark body .fcom_user_onboard .fcom_onboard_form :is(input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="tel"], textarea) {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  background: var(--color-ink);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-xl);
  box-shadow: none;
  color: var(--color-fg);
  font-size: 1rem;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.15s;
}

html.dark body .fcom_user_onboard .fcom_onboard_form :is(input, textarea)::placeholder {
  color: var(--color-mute);
  opacity: 1;
}

html.dark body .fcom_user_onboard .fcom_onboard_form :is(input, textarea):is(:focus, :focus-visible) {
  border-color: var(--color-lime);
  box-shadow: none;
  outline: none;
}

/* Browser autofill would paint the fields pale grey. */
html.dark body .fcom_user_onboard input:-webkit-autofill {
  -webkit-text-fill-color: var(--color-fg);
  -webkit-box-shadow: 0 0 0 100px var(--color-ink) inset;
  caret-color: var(--color-fg);
}

html.dark body .fcom_user_onboard .fcom_onboard_form .login-remember label,
html.dark body .fcom_user_onboard .fcom_onboard_form .fcom_inline_checkbox label {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0;
  color: var(--color-soft);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  cursor: pointer;
}

html.dark body .fcom_user_onboard input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--color-lime);
}

/* The submit: btn-primary, full width. */
html.dark body .fcom_layout_main .fcom_onboard_body .fcom_onboard_form :is(#wp-submit, .fcom_btn_submit, .fls_submit) {
  width: 100%;
  min-height: 2.75rem;
  margin-top: 0.5rem;
  padding: 0 1.25rem;
  background: var(--color-lime);
  border: 0;
  border-radius: var(--radius-xl);
  color: var(--color-on-lime);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), background-color 0.15s;
}

html.dark body .fcom_layout_main .fcom_onboard_body .fcom_onboard_form :is(#wp-submit, .fcom_btn_submit, .fls_submit):hover {
  background: var(--color-lime);
  color: var(--color-on-lime);
  transform: translateY(-2px);
}

html.dark body .fcom_layout_main .fcom_onboard_body .fcom_onboard_form :is(#wp-submit, .fcom_btn_submit, .fls_submit):focus-visible {
  outline: 2px solid var(--color-lime);
  outline-offset: 3px;
}

/* Below the form: a hairline, then quiet mono links (link-mono). */
html.dark body .fcom_user_onboard .fcom_spaced_divider {
  margin: 1.75rem 0 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--color-line);
}

html.dark body .fcom_user_onboard .fcom_spaced_divider :is(p, .fcom_alt_auth_text) {
  margin: 0;
  color: var(--color-mute);
  font-size: 0.875rem;
}

html.dark body .fcom_user_onboard .fcom_spaced_divider .fcom_alt_auth_text + p {
  margin-top: 0.5rem;
}

html.dark body .fcom_layout_main .fcom_spaced_divider a {
  color: var(--color-soft);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-decoration: none;
  transition: color 0.15s;
}

html.dark body .fcom_layout_main .fcom_spaced_divider a:hover {
  color: var(--color-lime);
}

html.dark body .fcom_user_onboard .fcom_field_error {
  color: #ff8a7a;
}

html.dark body .fcom_user_onboard .fcom_highlight_message {
  background: color-mix(in srgb, var(--color-lime) 4%, var(--color-panel));
  border: 1px solid color-mix(in srgb, var(--color-lime) 15%, transparent);
  border-radius: var(--radius-xl);
  color: var(--color-soft);
}

/* Phones: the brand side shrinks to a short intro above the form. */
@media (max-width: 768px) {
  html.dark body .fcom_full_layout.fluent_com_auth > div {
    flex: none;
  }

  html.dark body .fcom_full_layout.fluent_com_auth .fcom_layout_side {
    padding: 2.5rem 1.25rem 1.5rem;
    border: 0;
    background-image: none;
  }

  html.dark body .fcom_layout_side .fcom_welcome:not(:has(.fcom_logo))::before {
    width: 2.25rem;
    height: 2.25rem;
    margin-bottom: 1.5rem;
  }

  html.dark body .fcom_layout_main {
    align-items: flex-start;
    padding: 0 1.25rem 2.5rem;
  }

  html.dark body .fcom_layout_main .fcom_user_onboard {
    max-width: none;
    padding: 1.75rem 1.5rem;
  }
}
