/* Shared control colours. Scoped to the HappyGREEN frontend, outside vendor code.
 * White text: 4.97:1 on the base green, 7.15:1 on hover, 9.54:1 when pressed.
 * Important declarations intentionally override Elementor and plugin colour rules.
 */
body.hg-platform {
    --hg-action: #527b27;
    --hg-action-hover: #3f611c;
    --hg-action-active: #314d14;
    --hg-action-text: #fff;
    --hg-action-focus: #234311;
}

/* Every action uses the same colour pair, including visited download links. */
body.hg-platform #page :is(
    .hg-button, .hg-purchase-table-download, .hg-nav-table,
    a.button, button.button, input.button, input[type="submit"], input[type="button"], input[type="reset"], button[type="submit"],
    .woocommerce .quantity button,
    .elementor-button, .wp-block-button__link,
    .ur-submit-button, .user-registration-Button, .ur-button-container button,
    .ff-btn-submit, .wt-notify-btn,
    .hg-search-row button, .hg-carousel-controls button, .hg-mobile-menu > summary,
    .villa-details, .scrollup
),
body.hg-platform #fluentform_4 .ff-btn-submit {
    background-color: var(--hg-action) !important;
    background-image: none !important;
    color: var(--hg-action-text) !important;
    border-color: var(--hg-action) !important;
    text-shadow: none !important;
    box-shadow: none;
    text-decoration: none !important;
    opacity: 1 !important;
    /* Switch text and fill together: fading both can briefly erase the label. */
    transition: box-shadow .15s ease, border-color .15s ease;
}
body.hg-platform #page :is(
    .hg-button, .hg-purchase-table-download, .hg-nav-table,
    a.button, button.button, input.button, input[type="submit"], input[type="button"], input[type="reset"], button[type="submit"],
    .woocommerce .quantity button,
    .elementor-button, .wp-block-button__link,
    .ur-submit-button, .user-registration-Button, .ur-button-container button,
    .ff-btn-submit, .wt-notify-btn,
    .hg-search-row button, .hg-carousel-controls button, .hg-mobile-menu > summary,
    .villa-details, .scrollup
) :is(span, i),
body.hg-platform #fluentform_4 .ff-btn-submit :is(span, i) {
    color: inherit !important;
    text-shadow: none !important;
}

/* Secondary actions remain clearly outlined and use the same interaction states. */
body.hg-platform #page :is(.hg-secondary, .villa-details, .hg-nav-table, .hg-carousel-controls button, .hg-mobile-menu > summary, .woocommerce .quantity button) {
    background-color: #fff !important;
    color: var(--hg-action-hover) !important;
    border-color: var(--hg-action) !important;
}
body.hg-platform #page :is(
    .hg-button, .hg-purchase-table-download, .hg-nav-table,
    a.button, button.button, input.button, input[type="submit"], input[type="button"], input[type="reset"], button[type="submit"],
    .woocommerce .quantity button,
    .elementor-button, .wp-block-button__link,
    .ur-submit-button, .user-registration-Button, .ur-button-container button,
    .ff-btn-submit, .wt-notify-btn,
    .hg-search-row button, .hg-carousel-controls button, .hg-mobile-menu > summary,
    .villa-details, .scrollup
):is(:hover, :focus-visible),
body.hg-platform #fluentform_4 .ff-btn-submit:is(:hover, :focus-visible) {
    background-color: var(--hg-action-hover) !important;
    border-color: var(--hg-action-hover) !important;
    color: var(--hg-action-text) !important;
}
body.hg-platform #page :is(
    .hg-button, .hg-purchase-table-download, .hg-nav-table,
    a.button, button.button, input.button, input[type="submit"], input[type="button"], input[type="reset"], button[type="submit"],
    .woocommerce .quantity button,
    .elementor-button, .wp-block-button__link,
    .ur-submit-button, .user-registration-Button, .ur-button-container button,
    .ff-btn-submit, .wt-notify-btn,
    .hg-search-row button, .hg-carousel-controls button, .hg-mobile-menu > summary,
    .villa-details, .scrollup
):active,
body.hg-platform #fluentform_4 .ff-btn-submit:active {
    background-color: var(--hg-action-active) !important;
    border-color: var(--hg-action-active) !important;
    color: var(--hg-action-text) !important;
}

/* The account menu is navigation, including the link to the protected table. */
body.hg-platform .woocommerce-MyAccount-navigation a {
    color: var(--hg-action-hover) !important;
    background-color: #fff !important;
    text-decoration: none;
    transition: box-shadow .15s ease;
}
body.hg-platform .woocommerce-MyAccount-navigation a:is(:hover, :focus-visible),
body.hg-platform .woocommerce-MyAccount-navigation .is-active a {
    color: #fff !important;
    background-color: var(--hg-action-hover) !important;
}

/* Visible keyboard focus survives theme and plugin outline resets. */
body.hg-platform #page :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid var(--hg-action-focus) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 2px #fff !important;
}

/* Disabled actions stay legible and do not acquire an active hover colour. */
body.hg-platform #page :is(
    .hg-button, .hg-purchase-table-download, .hg-nav-table,
    a.button, button.button, input.button, input[type="submit"], input[type="button"], input[type="reset"], button[type="submit"],
    .woocommerce .quantity button,
    .elementor-button, .wp-block-button__link,
    .ur-submit-button, .user-registration-Button, .ur-button-container button,
    .ff-btn-submit, .wt-notify-btn,
    .hg-search-row button, .hg-carousel-controls button, .hg-mobile-menu > summary,
    .villa-details, .scrollup
):is(:disabled, [aria-disabled="true"], .disabled),
body.hg-platform #fluentform_4 .ff-btn-submit:is(:disabled, [aria-disabled="true"], .disabled) {
    background-color: #e0e6d9 !important;
    border-color: #9eac90 !important;
    color: #48533e !important;
    opacity: 1 !important;
    cursor: not-allowed;
}
body.hg-platform #fluentform_4 .ff-btn-submit {
    border-style: solid;
    border-width: 1px;
    border-radius: 2px;
    font: 15px/1.4 Arial, Helvetica, sans-serif;
    padding: 13px 25px;
}
@media (prefers-reduced-motion: reduce) {
    body.hg-platform #page :is(a, button, input, summary) { transition: none !important; }
}

/* Page numbers and account panels use the same palette instead of the parent blue. */
body.hg-platform #page :is(.woocommerce-pagination, .pagination) :is(ul, li) {
    border-color: #a1b78c !important;
}
body.hg-platform #page :is(.woocommerce-pagination, .pagination) .page-numbers {
    color: var(--hg-action-hover) !important;
    background-color: #fff !important;
    border-color: #a1b78c !important;
    transition: box-shadow .15s ease;
}
body.hg-platform #page :is(.woocommerce-pagination, .pagination) :is(a.page-numbers:hover, a.page-numbers:focus-visible, .page-numbers.current) {
    color: #fff !important;
    background-color: var(--hg-action-hover) !important;
}
body.hg-platform #page :is(.woocommerce-MyAccount-navigation a, .woocommerce-MyAccount-content) {
    border-color: #a1b78c !important;
}
