/* Shared client presentation. Native labels, form states and controllers stay
 * untouched. Publish as a new content-addressed asset, never over an old one. */
:root {
    --jart-button-radius: 10px;
    --jart-decorative-line: rgba(84, 71, 65, 0.10);
    --jart-search-surface: #f8faef;
    --jart-search-pointer-edge: #d1deb9;
    --jart-search-pointer-halo: rgba(152, 182, 92, 0.12);
    --jart-search-focus-ring: #7a8e52;
}

html.lagom-dark-mode {
    --jart-decorative-line: rgba(171, 207, 55, 0.10);
    --jart-search-surface: #1c2b20;
    --jart-search-pointer-edge: #4b6041;
    --jart-search-pointer-halo: rgba(171, 207, 55, 0.10);
    --jart-search-focus-ring: #a7c778;
}

/* Radius is stable when a button loads, disables, hovers or gains focus.
 * Joined controls receive only their exposed outer corners below; icon/circle/link
 * controls retain their existing geometry instead of becoming little pills. */
html body :is(.btn, button, input[type="submit"], input[type="button"], .jart-auth-continue, .jart-auth-create-account, .jart-cart-drawer-action):not(:where(.btn-icon, .btn-circle, .btn-link, .close, .jart-theme-toggle, .jart-password-toggle, .jart-cart-drawer-close, .jart-cart-drawer-item-remove, .navbar-toggle, .app-nav-toggle, .accordion-icon, .jaydenart-desktop-scroll-cue, .jaydenart-mobile-scroll-cue, [role="switch"], [role="checkbox"], [role="radio"], .btn-group *, .btn-group-vertical *, .input-group *, .input-group-btn *, .btn-toolbar *, .pagination *)),
html body.page-login .jart-account-navigation .nav-account-action > a {
    border-radius: var(--jart-button-radius) !important;
}

/* Account forms include high-specificity native IDs. These are radius-only:
 * neither password controls nor CAPTCHA layout/authentication is restyled. */
html body.page-login :is(#registration, #frmCheckout, .login-form, .loginForm) :is(.btn, button[type="submit"], input[type="submit"]):not(:where(.btn-icon, .btn-circle, .btn-link, .btn-group *, .input-group *)) {
    border-radius: var(--jart-button-radius) !important;
}

/* The dashboard domain panel wraps these two actions below its input with a
 * 16px gap. Its trailing CAPTCHA node makes the wrapper not :last-child;
 * neither action is part of a joined input seam in this inspected layout. */
html body #registerDomainPanel .input-group .input-group-btn > .btn {
    border-radius: var(--jart-button-radius) !important;
}

/* A joined group's outer corners match the shared radius. Logical corners
 * follow RTL without changing native order, width, spacing or visibility. */
html body :is(.btn-group, .input-group) > .btn:first-child:not(:where(.btn-icon, .btn-circle, .btn-link)),
html body .input-group > .input-group-btn:first-child > .btn:first-child:not(:where(.btn-icon, .btn-circle, .btn-link)) {
    border-start-start-radius: var(--jart-button-radius) !important;
    border-end-start-radius: var(--jart-button-radius) !important;
    border-start-end-radius: 0 !important;
    border-end-end-radius: 0 !important;
}

html body :is(.btn-group, .input-group) > .btn:last-child:not(:where(.btn-icon, .btn-circle, .btn-link)),
html body .input-group > .input-group-btn:last-child > .btn:last-child:not(:where(.btn-icon, .btn-circle, .btn-link)) {
    border-start-start-radius: 0 !important;
    border-end-start-radius: 0 !important;
    border-start-end-radius: var(--jart-button-radius) !important;
    border-end-end-radius: var(--jart-button-radius) !important;
}

html body .btn-group-vertical > .btn:first-child:not(:where(.btn-icon, .btn-circle, .btn-link)) {
    border-start-start-radius: var(--jart-button-radius) !important;
    border-start-end-radius: var(--jart-button-radius) !important;
    border-end-start-radius: 0 !important;
    border-end-end-radius: 0 !important;
}

html body .btn-group-vertical > .btn:last-child:not(:where(.btn-icon, .btn-circle, .btn-link)) {
    border-start-start-radius: 0 !important;
    border-start-end-radius: 0 !important;
    border-end-start-radius: var(--jart-button-radius) !important;
    border-end-end-radius: var(--jart-button-radius) !important;
}

html body :is(.btn-group, .btn-group-vertical) > .btn:only-child:not(:where(.btn-icon, .btn-circle, .btn-link)) {
    border-radius: var(--jart-button-radius) !important;
}

/* Lagom's trailing loader is always present, so :last-child cannot identify
 * the remove button. A hidden remove leaves one complete, rounded Add action;
 * when it appears the pair has one outer boundary and a square inner seam. */
html body #DomainSearchResults .btn-group-remove > .btn-add-to-cart {
    border-start-start-radius: var(--jart-button-radius) !important;
    border-end-start-radius: var(--jart-button-radius) !important;
    border-start-end-radius: 0 !important;
    border-end-end-radius: 0 !important;
}

html body #DomainSearchResults .btn-group-remove > .btn-remove-domain {
    border-start-start-radius: 0 !important;
    border-end-start-radius: 0 !important;
    border-start-end-radius: var(--jart-button-radius) !important;
    border-end-end-radius: var(--jart-button-radius) !important;
}

html body #DomainSearchResults .btn-group-remove:has(> .btn-remove-domain.hidden) > .btn-add-to-cart {
    border-radius: var(--jart-button-radius) !important;
}

/* The reviewed primary result group has an 8px gap, not joined corners.
 * Both actions stay independently rounded in its before/after-cart states. */
html body #DomainSearchResults #primaryLookupResult .message-actions .btn-group > .btn:not(:where(.btn-icon, .btn-circle, .btn-link)),
html body #DomainSearchResults .jart-domain-cart-link {
    border-radius: var(--jart-button-radius) !important;
}

@media (forced-colors: none) {
    /* These outlines divide surfaces, not controls. Static surfaces remain
     * quiet under the pointer; actual interactive-card hover, keyboard focus
     * and semantic/selection boundaries retain their stronger treatment. */
    html body :is(.panel, .card, .well, .modal-content, .package.is-boxed, .feature.feature-horizontal, .footer-company, .footer-site-map, .login-body):not(:where(.panel-primary, .panel-info, .panel-success, .panel-warning, .panel-danger, .card-primary, .card-info, .card-success, .card-warning, .card-danger, .alert, [role="alert"], [role="status"], [role="button"], [role="radio"], [role="checkbox"], .active, .selected, .is-selected, .is-featured, .package-featured, .featured, [aria-selected="true"], [aria-checked="true"], [aria-invalid="true"], :is(a, button, [tabindex], [data-toggle]):hover, :focus, :focus-within)) {
        border-color: var(--jart-decorative-line) !important;
    }

    html body :is(.panel-heading, .panel-footer, .card-header, .card-footer, .modal-header, .modal-footer, .footer-title, hr):not(:where(.panel-primary *, .panel-info *, .panel-success *, .panel-warning *, .panel-danger *, .card-primary *, .card-info *, .card-success *, .card-warning *, .card-danger *, .alert *, [role="alert"] *, [role="status"] *, [role="button"], .active, .selected, :is(a, button, [tabindex], [data-toggle]):hover, :focus, :focus-within)) {
        border-color: var(--jart-decorative-line) !important;
    }

    /* Lagom's primary, secondary and primary-faded variants have fills. Its
     * default variant is transparent, so it and explicit outlines stay native.
     * The state selector matches the existing global brand hover specificity;
     * it changes only the edge, never fill, text, keyboard ring or geometry.
     * Account/cart-specific edges already equal their owned solid fills. */
    html:is(.lagom-dark-mode, :not(.lagom-dark-mode)) body :is(.btn.btn-primary, .btn.btn-secondary, .btn.btn-primary-faded):not(:where(.btn-default, .btn-outline, .btn-outlined, .btn-outline-primary, .btn-primary-outline, .btn-outline-secondary, .btn-secondary-outline, .btn-faded, .btn-link, .btn-success, .btn-info, .btn-warning, .btn-danger, .btn-icon, .btn-circle, .active, .selected, .is-selected, [aria-pressed="true"], [aria-selected="true"], [aria-expanded="true"], [aria-invalid="true"], .error, .is-invalid, #DomainSearchResults *, :disabled, .disabled, .btn-disabled, .is-disabled, .unavailable, [aria-disabled="true"])),
    html:is(.lagom-dark-mode, :not(.lagom-dark-mode)) body :is(.btn.btn-primary, .btn.btn-secondary, .btn.btn-primary-faded):is(:hover, :focus, :focus-visible, :active):not(:where(.btn-default, .btn-outline, .btn-outlined, .btn-outline-primary, .btn-primary-outline, .btn-outline-secondary, .btn-secondary-outline, .btn-faded, .btn-link, .btn-success, .btn-info, .btn-warning, .btn-danger, .btn-icon, .btn-circle, .active, .selected, .is-selected, [aria-pressed="true"], [aria-selected="true"], [aria-expanded="true"], [aria-invalid="true"], .error, .is-invalid, #DomainSearchResults *, :disabled, .disabled, .btn-disabled, .is-disabled, .unavailable, [aria-disabled="true"])) {
        border-color: transparent !important;
        background-clip: border-box !important;
    }

    /* The consent trigger is a filled bespoke button, not a .btn variant.
     * Preserve its native fill, focus ring, disabled states and compact mode. */
    html body #jac-settings-trigger.jac-settings-trigger:not(:where(:disabled, .disabled, .is-disabled, [aria-disabled="true"], [aria-pressed="true"], [aria-selected="true"], [aria-expanded="true"])),
    html body #jac-settings-trigger.jac-settings-trigger:is(:hover, :focus, :focus-visible, :active):not(:where(:disabled, .disabled, .is-disabled, [aria-disabled="true"], [aria-pressed="true"], [aria-selected="true"], [aria-expanded="true"])) {
        border-color: transparent !important;
        background-clip: border-box !important;
    }

    /* Native domain actions sit inside a button group and the spotlight uses
     * a faded class despite receiving the same solid green fill. Match that
     * fill, including hover/focus, without recoloring cart/status states. */
    html body #DomainSearchResults .btn.btn-add-to-cart:not(:where(.btn-disabled, .disabled, .is-disabled, .unavailable, :disabled, [aria-disabled="true"], [data-jart-cart-state="added"], [data-jart-cart-state="unknown"])),
    html body #DomainSearchResults #primaryLookupResult .jart-domain-cart-link {
        border-color: #b5d45e !important;
        background-clip: border-box !important;
        box-shadow: inset 0 1px rgba(244, 249, 219, 0.55), 0 2px 8px rgba(87, 112, 36, 0.08) !important;
    }

    /* This exact search wrapper owns no authentication or checkout fields.
     * Invalid/readonly/disabled inputs retain the existing surface and rails. */
    html body #frmDomainChecker .domain-search-input:has(#inputDomain):not(:where(.has-error, .has-danger, .has-error *, .has-danger *, :has(.has-error, .has-danger, #inputDomain:invalid, #inputDomain[aria-invalid="true"], #inputDomain[readonly], #inputDomain:disabled))) {
        background-color: var(--jart-search-surface) !important;
    }

    /* The keyboard/unknown-modality outline stays two pixels and exceeds
     * 3:1 against this field in both themes, using sage instead of dark olive. */
    html body #frmDomainChecker .domain-search-input #inputDomain:focus:not(:where(:invalid, [aria-invalid="true"], [readonly], :disabled, .has-error *, .has-danger *)) {
        outline-color: var(--jart-search-focus-ring) !important;
    }

    /* Text inputs match :focus-visible even after a click. Use the domain
     * runtime's existing modality signal, never suppress unknown/keyboard
     * focus. A pointer gets a quiet tonal inset; Tab keeps the stronger ring. */
    html[data-jart-domain-input="pointer"] body #frmDomainChecker .domain-search-input #inputDomain:focus:not(:where(:invalid, [aria-invalid="true"], [readonly], :disabled, .has-error *, .has-danger *)) {
        background-color: var(--jart-search-surface) !important;
        outline: 1px solid var(--jart-search-pointer-edge) !important;
        outline-offset: 0 !important;
        box-shadow: 0 0 0 3px var(--jart-search-pointer-halo) !important;
    }
}

/* No text, dimensions, visibility, animation or JS changes. Only the inspected
 * domain field gets a quieter outline. Keyboard/unknown input modality keeps
 * the native ring geometry; forced-colors bypasses these color overrides. */
