:root {
  --mocsr-ink: var(--ast-global-color-0, #1b130e);
  --mocsr-paper: var(--ast-global-color-5, #faf9f6);
  --mocsr-gold: var(--ast-global-color-8, #ffce70);
  --mocsr-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Astra header: the utility bar scrolls away; the main bar returns on upward scroll. */
body.mocsr-smart-header #masthead {
  transition: transform 420ms var(--mocsr-ease), background-color 320ms ease, box-shadow 320ms ease;
  will-change: transform;
}

body.mocsr-smart-header #masthead.mocsr-header-is-sticky {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 999;
  background: var(--mocsr-paper);
  border-bottom: 1px solid rgba(27, 19, 14, 0.18);
  border-bottom-color: color-mix(in srgb, var(--mocsr-ink) 18%, transparent);
  box-shadow: 0 8px 28px rgba(27, 19, 14, 0.07);
}

body.admin-bar.mocsr-smart-header #masthead.mocsr-header-is-sticky {
  top: 32px;
}

body.mocsr-smart-header #masthead.mocsr-header-is-sticky .ast-above-header-wrap {
  display: none;
}

body.mocsr-smart-header #masthead.mocsr-header-is-sticky.mocsr-header-hidden {
  transform: translateY(calc(-100% - 2px));
}

body.mocsr-smart-header #masthead.mocsr-header-is-sticky.mocsr-header-visible {
  transform: translateY(0);
}

body.mocsr-smart-header .main-header-bar-wrap .main-header-menu > .menu-item > .menu-link,
body.mocsr-smart-header .main-header-bar-wrap .ast-site-header-cart .cart-container {
  position: relative;
}

body.mocsr-smart-header .main-header-bar-wrap .main-header-menu > .menu-item > .menu-link::after,
body.mocsr-smart-header .main-header-bar-wrap .ast-site-header-cart .cart-container::after {
  position: absolute;
  right: 0;
  bottom: 0.65em;
  left: 0;
  height: 1px;
  background: var(--mocsr-gold);
  content: "";
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 320ms var(--mocsr-ease);
}

body.mocsr-smart-header .main-header-bar-wrap .main-header-menu > .menu-item > .menu-link:hover::after,
body.mocsr-smart-header .main-header-bar-wrap .main-header-menu > .menu-item > .menu-link:focus-visible::after,
body.mocsr-smart-header .main-header-bar-wrap .ast-site-header-cart .cart-container:hover::after,
body.mocsr-smart-header .main-header-bar-wrap .ast-site-header-cart .cart-container:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Site-wide linear fields. The certificate verifier is intentionally excluded. */
.mocsr-field {
  position: relative;
  display: block;
  width: 100%;
  padding-top: 8px;
}

.mocsr-floating-label {
  position: absolute;
  top: 22px;
  left: 0;
  z-index: 2;
  max-width: 100%;
  overflow: hidden;
  color: #6b625c;
  color: color-mix(in srgb, var(--mocsr-ink) 66%, transparent);
  font: inherit;
  font-size: 0.96em;
  font-weight: 450;
  line-height: 1.2;
  pointer-events: none;
  text-overflow: ellipsis;
  transform: translateY(0);
  transform-origin: left top;
  transition: top 320ms var(--mocsr-ease), color 320ms ease, font-size 320ms ease, transform 320ms var(--mocsr-ease);
  white-space: nowrap;
}

.mocsr-field.has-focus .mocsr-floating-label,
.mocsr-field.has-value .mocsr-floating-label {
  top: 1px;
  color: var(--mocsr-gold);
  font-size: 0.72em;
}

body.mocsr-site-refinements :where(input:not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]), textarea, select):not(.certificate-input):not(.select2-hidden-accessible) {
  width: 100%;
  min-height: 42px;
  padding: 11px 0 5px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--mocsr-ink) !important;
  border-radius: 0 !important;
  outline: 0;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  color: var(--mocsr-ink);
  font: inherit;
  line-height: 1.35;
  transition: border-color 280ms ease, color 280ms ease;
  -webkit-appearance: none;
  appearance: none;
}

body.mocsr-site-refinements textarea:not(.certificate-input) {
  min-height: 96px;
  resize: vertical;
}

body.mocsr-site-refinements select:not(.select2-hidden-accessible) {
  padding-right: 28px !important;
  -webkit-appearance: auto;
  appearance: auto;
}

body.mocsr-site-refinements :where(input:not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]), textarea, select):not(.certificate-input):not(.select2-hidden-accessible):focus {
  border: 0 !important;
  border-bottom: 1px solid var(--mocsr-gold) !important;
  outline: 0;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

.mocsr-field > input::placeholder,
.mocsr-field > textarea::placeholder {
  color: transparent;
  opacity: 0;
}

.certificate-verification-form .certificate-input,
.certificate-verification-form .certificate-input:focus {
  /* Preserve the homepage certificate component exactly as authored. */
}

/* LearnDash: purpose-built navigation replaces only the native mobile action row. */
.mocsr-mobile-course-nav {
  display: none;
}

@media (max-width: 767px) {
  body.admin-bar.mocsr-smart-header #masthead.mocsr-header-is-sticky {
    top: 46px;
  }

  body.mocsr-learndash-screen .learndash-wrapper .ld-content-actions {
    display: block !important;
    padding: 24px 0 8px;
    border-top: 0;
  }

  body.mocsr-learndash-screen .learndash-wrapper .ld-content-actions > .ld-content-action,
  body.mocsr-learndash-screen .learndash-wrapper .ld-content-actions > a.ld-content-action {
    display: none !important;
  }

  .mocsr-mobile-course-nav {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 14px;
  }

  .mocsr-mobile-course-nav__primary,
  .mocsr-mobile-course-nav__primary form,
  .mocsr-mobile-course-nav__primary .learndash_timer {
    width: 100%;
    margin: 0;
  }

  .mocsr-mobile-course-nav .mocsr-course-primary,
  .mocsr-mobile-course-nav button.mocsr-course-primary {
    display: inline-flex !important;
    width: 100% !important;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 !important;
    padding: 12px 22px !important;
    border: 1px solid var(--mocsr-ink) !important;
    border-radius: 40px 5px 40px 40px !important;
    background: var(--mocsr-paper) !important;
    box-shadow: none !important;
    color: var(--mocsr-ink) !important;
    font-family: inherit;
    font-size: 0.93rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
    text-transform: none;
    cursor: pointer;
    transition: color 320ms ease, border-color 320ms ease, transform 320ms var(--mocsr-ease) !important;
  }

  .mocsr-mobile-course-nav .mocsr-course-primary:hover,
  .mocsr-mobile-course-nav .mocsr-course-primary:focus-visible {
    border-color: var(--mocsr-ink) !important;
    background: var(--mocsr-paper) !important;
    color: var(--mocsr-gold) !important;
    transform: translateY(-1px);
  }

  .mocsr-mobile-course-nav .mocsr-course-primary:focus-visible,
  .mocsr-mobile-course-nav .mocsr-course-previous:focus-visible {
    outline: 2px solid var(--mocsr-gold);
    outline-offset: 3px;
  }

  .mocsr-mobile-course-nav .mocsr-course-primary:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
  }

  .mocsr-check {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }

  .mocsr-mobile-course-nav__previous {
    display: flex;
    justify-content: center;
  }

  .mocsr-mobile-course-nav .mocsr-course-previous {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 8px;
    color: var(--mocsr-ink);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.35;
    text-decoration: none;
    transition: color 280ms ease;
  }

  .mocsr-mobile-course-nav .mocsr-course-previous:hover,
  .mocsr-mobile-course-nav .mocsr-course-previous:focus-visible {
    color: var(--mocsr-gold);
  }

  .mocsr-arrow {
    transition: transform 280ms var(--mocsr-ease);
  }

  .mocsr-course-primary:hover .mocsr-arrow,
  .mocsr-course-primary:focus-visible .mocsr-arrow {
    transform: translateX(3px);
  }

  .mocsr-course-previous:hover .mocsr-arrow,
  .mocsr-course-previous:focus-visible .mocsr-arrow {
    transform: translateX(-3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.mocsr-smart-header #masthead,
  body.mocsr-smart-header #masthead *,
  .mocsr-floating-label,
  .mocsr-mobile-course-nav * {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}
