/* Platform tertiary button. Promoted from RequestWorkflow/List .summary-report a
 * (List/style.css:556-571 and List.cshtml:93-95) then copied into
 * GuestListConfirmation.
 *
 * The third button role, after .btn-success / .btn-secondary: no fill, no
 * border, --sw-text-link at --sw-font-size-sm, and a 1px rule that wipes in
 * from the left on hover. Linked from _Layout. The hairline has no token.
 *
 * .highlight — --sw-font-weight-bold. Table cells that link to the row's item
 * (a request ID, a name). Not for actions.
 *
 * Goes on the interactive element — <button> or <a> — not a wrapper. Button
 * chrome is stripped so a <button type="button"> reads as a link (Space must
 * be able to activate it).
 *
 * Hover uses (hover: hover), not List's min-width:1200px. That query was a
 * desktop proxy from before hover was queryable; a 720px dialog would never
 * match it. */

.btn-tertiary {
    position: relative;
    display: inline-block;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--sw-text-link);
    font-family: inherit;
    font-size: var(--sw-font-size-sm);
    font-weight: inherit;
    line-height: inherit;
    text-align: inherit;
    text-decoration: none;
    cursor: pointer;
}

.btn-tertiary.highlight {
    font-weight: var(--sw-font-weight-bold);
}

.btn-tertiary:hover,
.btn-tertiary:focus,
.btn-tertiary:visited {
    color: var(--sw-text-link);
    text-decoration: none;
}

.btn-tertiary::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    height: 1px;
    width: 0;
    background-color: currentColor;
    transition: var(--sw-transition);
}

@media (hover: hover) {
    .btn-tertiary:hover::before {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn-tertiary::before {
        transition-duration: .001ms;
    }
}

/* Not available. aria-disabled when it must keep focus and its words ("Re-send code in 0:29"),
 * and the script ignores the click; disabled for a moment's wait such as a code being checked.
 * Muted, no pointer and no underline on hover. */
.btn-tertiary[aria-disabled="true"],
.btn-tertiary[aria-disabled="true"]:hover,
.btn-tertiary[aria-disabled="true"]:focus,
.btn-tertiary:disabled {
    color: var(--sw-text-subtle);
    cursor: default;
}

.btn-tertiary[aria-disabled="true"]::before,
.btn-tertiary:disabled::before {
    width: 0;
}

/* The destructive role. Bootstrap ships .btn-danger at #dc3545 and nothing in this
 * codebase overrode it, so every destructive button in the product has been rendering
 * an unintended default — tokens.css named --sw-danger-solid for exactly this and
 * nothing consumed it.
 *
 * Only the colours are set here. Bootstrap's own sizing, radius, focus ring and
 * disabled handling are left alone; this is the same role it already defines, in the
 * right colour.
 *
 * :hover and :active share one value. Bootstrap's ladder is #dc3545 → #bb2d3b → #b02a37,
 * and we start where its :active ends, so both states step down to --sw-danger-solid-hover
 * rather than inventing a third shade. Ungated by (hover: hover) on purpose: Bootstrap's
 * own :hover is ungated, so gating ours would let its #bb2d3b show through on a tap. */

.btn-danger {
    color: var(--sw-text-inverse);
    background-color: var(--sw-danger-solid);
    border-color: var(--sw-danger-solid);
    transition: var(--sw-transition);
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
.btn-danger.active {
    color: var(--sw-text-inverse);
    background-color: var(--sw-danger-solid-hover);
    border-color: var(--sw-danger-solid-hover);
}

.btn-danger:disabled,
.btn-danger.disabled {
    color: var(--sw-text-inverse);
    background-color: var(--sw-danger-solid);
    border-color: var(--sw-danger-solid);
}

@media (prefers-reduced-motion: reduce) {
    .btn-danger {
        transition-duration: .001ms;
    }
}

/* The primary role on public pages (sign-in, MFA, registration). In the app it comes from
 * styles.css plus the tenant's .button-color, which paints only the fill, so Bootstrap's green
 * edge showed round the tenant colour once these pages stopped loading the Bootstrap 2 sheet.
 * Here fill, edge and text all read tokens: the tenant colour Theme writes, else --sw-primary.
 * Scoped to [data-sw-app="public"] so no admin button changes; unscoping it is a separate call. */

[data-sw-app="public"] .btn-success,
[data-sw-app="public"] .btn-success:hover,
[data-sw-app="public"] .btn-success:focus,
[data-sw-app="public"] .btn-success:active,
[data-sw-app="public"] .btn-success:disabled {
    color: var(--sw-primary-text);
    background-color: var(--sw-brand-button, var(--sw-primary));
    border-color: var(--sw-brand-button, var(--sw-primary));
}

/* The dismiss role. UI-RULES says .btn-secondary is white, but styles.css only makes it
 * white inside .new-layout-wrapper (:7426), with hover inside .modal and the wrapper on
 * desktop widths only (:7713, :7806). Outside the wrapper it fell back to Bootstrap's filled
 * grey. That covered a dialog moved to <body> to escape a stacking context, and any page not
 * wrapped in .new-layout-wrapper. This is the same rule, unscoped. The wrapper rules set the
 * same values, so where they match nothing changes.
 *
 * :focus and :disabled stay white. The wrapper rule already kept them white, because it
 * beats Bootstrap's grey :focus and :disabled on source order. Hover and active fill with
 * the border colour, as the wrapper does. They are ungated for the same reason as
 * .btn-danger. A .btn-check toggle that is :checked keeps Bootstrap's darker fill,
 * because that selector is more specific. */

.btn-secondary,
.btn-secondary:focus,
.btn-secondary:disabled,
.btn-secondary.disabled {
    color: var(--sw-secondary-text);
    background-color: var(--sw-surface);
    border-color: var(--sw-secondary-border);
    transition: var(--sw-transition);
}

.btn-secondary:hover,
.btn-secondary:active,
.btn-secondary.active {
    color: var(--sw-text-inverse);
    background-color: var(--sw-secondary-border);
    border-color: var(--sw-secondary-border);
}

@media (prefers-reduced-motion: reduce) {
    .btn-secondary {
        transition-duration: .001ms;
    }
}

/* Bootstrap's .btn-sm has no height, so a short or icon-only button sits shorter than
 * the row. 31px is where it already lands with one line of text: a floor, not a resize. */

.btn-sm {
    min-height: 31px;
}
