/* Keep signed-in and legacy views on the same PairChamp green brand as Home. */
body {
    --pc-button-font-size: 14px;
    --pc-button-color: #456332;
    --pc-button-hover: #35502a;
}

/* Legacy pages and embedded portals load local styles after the shared head. */
body :is(
    button,
    input[type="submit"],
    input[type="button"],
    input[type="reset"],
    a.btn,
    a[class*="-btn"],
    a[class*="btn-"],
    a[class*="-button"],
    a.pc-standing-link,
    a.pt-action,
    a.pc-back
):not([role="gridcell"]):not(.ac-square):not(.pc-square):not(.pcb-promo-btn) {
    font-size: var(--pc-button-font-size) !important;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif !important;
    line-height: 1.4 !important;
}

body :is(
    a.btn, button.btn,
    a[class*="-btn"], button[class*="-btn"],
    a[class*="btn-"], button[class*="btn-"],
    a[class*="-button"], button[class*="-button"],
    a.pc-standing-link, a.pt-action, a.pc-back,
    input[type="submit"], button[type="submit"]
):not([class*="danger"]):not([class*="delete"]):not([class*="warning"]):not([class*="success"]):not([class*="result"]):not([class*="win"]):not([class*="loss"]):not([class*="draw"]):not([class*="tab"]):not(.pc-burger):not(.pc-profile-btn):not(.pc-notif-btn):not(.pc-nav-link):not(.pcb-promo-btn) {
    background: var(--pc-button-color) !important;
    border-color: var(--pc-button-color) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    text-decoration: none;
}

body :is(
    a.btn, button.btn,
    a[class*="-btn"], button[class*="-btn"],
    a[class*="btn-"], button[class*="btn-"],
    a[class*="-button"], button[class*="-button"],
    a.pc-standing-link, a.pt-action, a.pc-back,
    input[type="submit"], button[type="submit"]
):not([class*="danger"]):not([class*="delete"]):not([class*="warning"]):not([class*="success"]):not([class*="result"]):not([class*="win"]):not([class*="loss"]):not([class*="draw"]):not([class*="tab"]):not(.pc-burger):not(.pc-profile-btn):not(.pc-notif-btn):not(.pc-nav-link):not(.pcb-promo-btn):hover:not(:disabled):not([aria-disabled="true"]) {
    background: var(--pc-button-hover) !important;
    border-color: var(--pc-button-hover) !important;
    filter: none !important;
}

body:not(.pc-public-theme) {
    --pc-primary: #769656;
    --pc-primary-dark: #456332;
    --pc-primary-deep: #35502a;
    --pc-primary-soft: #edf3e7;
    --pc-blue: #456332;
    --pc-blue-2: #35502a;
    --pc-ink: #202a25;
    --pc-muted: #59665f;
    --pc-border: #dfe5da;
    --pc-bg: #f7f8f5;
    --pc-bg1: #f7f8f5;
    --pc-bg2: #ffffff;
    --pc-card: #ffffff;
    --bg: #f7f8f5;
    --surface: #ffffff;
    --surface-2: #edf3e7;
    --text: #202a25;
    --muted: #59665f;
    --border: #dfe5da;
    --blue: #769656;
    --blue-2: #456332;
    --blue-ghost: #edf3e7;
    --focus: #7696564d;
    --ot-primary: #769656;
    --ot-primary-dark: #456332;
    --cw-primary: #769656;
    --cw-primary-dark: #456332;
    --cmf-blue: #769656;
    --cmf-blue-2: #456332;
    --cmf-soft: #edf3e7;
    color: #202a25;
    background:
        radial-gradient(ellipse at 92% 0, #76965612, transparent 34%),
        #f7f8f5;
    accent-color: #456332;
}

body:not(.pc-public-theme) :is(
    :where(a:not([class*="danger"]):not([class*="delete"]):not([class*="warning"]):not([class*="success"]):not([class*="status"]):not([class*="badge"]):not([class*="result"]):not([class*="state"]):not([class*="win"]):not([class*="loss"]):not([class*="draw"]):not([class*="pending"]):not([class*="disabled"]):not(.is-active):not(.active):not([aria-current]):not([aria-disabled="true"])),
    .pc-title,
    .pc-page-title,
    .scw-title,
    .ot-page-header h1
) {
    color: #456332;
}

body:not(.pc-public-theme) :is(
    .pc-header,
    .pc-sticky
) {
    background: #fffffffa;
    border-bottom-color: #dfe5da;
    box-shadow: 0 2px 12px #18231a0a;
}

body:not(.pc-public-theme) .pc-header::before {
    background: linear-gradient(90deg, #769656 0%, #456332 55%, #35502a 100%);
}

body:not(.pc-public-theme) :is(
    .pc-header .pc-nav-link,
    .pc-header .pc-mobile-link,
    .pc-header .pc-dd-item,
    .pc-header .pc-profile-item
) {
    color: #202a25;
}

body:not(.pc-public-theme) :is(
    .pc-header .pc-nav-link:hover,
    .pc-header .pc-mobile-link:hover,
    .pc-header .pc-dd-item:hover,
    .pc-header .pc-profile-item:hover
) {
    background: #edf3e7;
    color: #35502a;
}

body:not(.pc-public-theme) :is(
    .btn-primary,
    .pc-btn-primary,
    .ot-btn-primary,
    .cmf-btn-primary,
    .cw-btn-primary,
    .pc-button-primary,
    .btn.primary,
    button.primary:not(.pc-alert):not(.status):not(.badge),
    a.primary:not(.pc-alert):not(.status):not(.badge)
) {
    background: linear-gradient(135deg, #456332, #35502a);
    border-color: #456332;
    color: #ffffff;
}

body:not(.pc-public-theme) :is(
    .org-nav-link.is-active,
    .ot-nav-link.is-active,
    .pc-tab.is-active,
    .tabbtn.active
) {
    background: linear-gradient(135deg, #769656, #456332);
    border-color: #456332;
    color: #ffffff;
}

body:not(.pc-public-theme) :is(
    .btn-soft,
    .pc-btn-secondary,
    .ot-btn-secondary,
    .pc-btn-ghost,
    .pc-back
) {
    background-color: #edf3e7;
    border-color: #dfe5da;
    color: #456332;
}

body:not(.pc-public-theme) :is(
    .ot-page-header,
    .ot-kpi,
    .org-sidebar,
    .cmf-stage-card,
    .cmf-steps-wrap,
    .cw-card,
    .scw-card,
    .scw-panel,
    .club-members-panel,
    .pc-workspace-card,
    .pc-workspace-panel,
    .pc-card,
    .pc-panel,
    .pc-card-panel
) {
    background-color: #ffffff;
    border-color: #dfe5da;
    box-shadow: 0 4px 20px #18231a0a;
}

body:not(.pc-public-theme) :is(input, select, textarea, button):focus-visible {
    outline-color: #769656;
    border-color: #769656;
    box-shadow: 0 0 0 3px #76965626;
}

@media (prefers-reduced-motion: no-preference) {
    body:not(.pc-public-theme) :is(.btn-primary, .pc-btn-primary, .ot-btn-primary, .cmf-btn-primary) {
        transition: filter 140ms ease, box-shadow 140ms ease;
    }

    body:not(.pc-public-theme) :is(.btn-primary, .pc-btn-primary, .ot-btn-primary, .cmf-btn-primary):hover {
        filter: brightness(0.96);
        box-shadow: 0 6px 16px #45633226;
    }
}
