/********** Button base styles **********/

a.button {
    text-decoration: none;
    display: flex;
}

.button,
button {
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-family: var(--ssn-source-sans-font-family);
    font-style: normal;
    font-weight: 600;
    line-height: 1.75em;
    letter-spacing: 0.8px;
    text-align: center;

    /* large by default */
    padding: 8px 12px;
    font-size: 16px;

}

.button.medium,
button.medium {
    padding: 6px 12px;
    font-size: 14px;
}

.button.small,
button.small {
    padding: 2px 8px;
    font-size: 14px;
}

.button.mini,
button.mini {
    padding: 3px 12px;
    font-size: 12px;
    line-height: 1.5em;
}

.button:focus-visible,
button:focus-visible {
    outline: 2px solid var(--ssn-other-focus-ring);
}

.button.loading,
button.loading {
    position: relative;
    content: "";
}

/* TODO: This should be updated to match the loading state as defined by the button design document */
.button.loading::after,
button.loading::after{
    display: flex;
    position: absolute;
    width: 100%;
    height: 100%;
    content: 'Loading...';
    align-items: center;
    justify-content: center;
    background-color: inherit;
    border-radius: inherit;
}

.button:disabled,
button:disabled {
    cursor: not-allowed;
}

/********** SolidPrimary button styles **********/

.button.solid__primary,
button.solid__primary {
    background: var(--ssn-button-fill-primary);
    color: var(--ssn-text-on-primary);
}

.button.solid__primary:hover,
button.solid__primary:hover {
    background: var(--ssn-button-fill-primary-hover);
}

.button.solid__primary:active,
button.solid__primary:active {
    background: var(--ssn-button-fill-primary-active);
}

.button.solid__primary:focus-visible,
button.solid__primary:focus-visible {
    background: var(--ssn-button-fill-primary-active);
}

.button.solid__primary:disabled,
button.solid__primary:disabled {
    background: var(--ssn-button-fill-disabled);
    color: var(--ssn-text-disabled);
}


/********** SolidNeutral button styles **********/

.button.solid__neutral,
button.solid__neutral {
    background: var(--ssn-button-fill-secondary);
    color: var(--ssn-text-button);
}

.button.solid__neutral:hover,
button.solid__neutral:hover {
    background: var(--ssn-button-fill-secondary-hover);
}

.button.solid__neutral:active,
button.solid__neutral:active {
    background: var(--ssn-button-fill-secondary-active);
}

.button.solid__neutral:focus-visible,
button.solid__neutral:focus-visible {
    background: var(--ssn-button-fill-secondary-active);
}

.button.solid__neutral:disabled,
button.solid__neutral:disabled {
    background: var(--ssn-button-fill-disabled);
    color: var(--ssn-text-disabled);
}


/********** TextPrimary button styles **********/

.button.text__primary,
button.text__primary {
    background: none;
    color: var(--ssn-text-action);
}

.button.text__primary:hover,
button.text__primary:hover {
    background: var(--ssn-button-fill-white-hover);
}

.button.text__primary:active,
button.text__primary:active {
    background: var(--ssn-button-fill-white-active);
}

.button.text__primary:focus-visible,
button.text__primary:focus-visible {
    background: var(--ssn-button-fill-white-active);
}

/********** OultinedPrimary button styles **********/

.button.outlined__primary,
button.outlined__primary {
    background: none;
    color: var(--ssn-text-action);
    outline: 1px solid var(--ssn-button-fill-primary);
    outline-offset: -1px;
}

.button.outlined__primary:hover,
button.outlined__primary:hover {
    background: var(--ssn-button-fill-white-hover);
}

.button.outlined__primary:active,
button.outlined__primary:active {
    background: var(--ssn-button-fill-white-active);
}

.button.outlined__primary:focus-visible,
button.outlined__primary:focus-visible {
    background: var(--ssn-button-fill-white-active);
    outline: 2px solid var(--ssn-other-focus-ring);
    outline-offset: -0;
}

/********** External login buttons (SN-3947) **********/

/* The divider between the password form and the external login links. Decoration
   between a form and two links, hence `aria-hidden` in the markup. */
/* The divider and the buttons sit beside the form, directly in `.card`, which has no
   side padding and does not stretch its children (`align-items: start`): both stretch
   themselves and take `.form-body`'s 24px sides, so they line up with the submit button,
   and both name the page's font, which `.card` does not set (live check, 2026-10-29). */
.sso-divider {
    display: flex;
    align-items: center;
    align-self: stretch;
    gap: 8px;
    margin: 16px 24px 8px;
    color: var(--ssn-grey-600, #868E96);
    font-family: var(--ssn-source-sans-font-family);
    font-size: 0.875rem;
}

.sso-divider::before,
.sso-divider::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--ssn-grey-300, #DEE2E6);
}

.sso-buttons {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    gap: 8px;
    margin: 0 24px 16px;
}

/* ONE shared rule sets the box, so no external login button can end up smaller than
   another or than the form's submit button (Apple's HIG: never smaller than the other
   sign-in buttons, at least 44px tall). The brand rules below set colours and the mark
   and NOTHING about the box. */
.sso-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: var(--ssn-source-sans-font-family);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    cursor: pointer;
}

/* A real link, so a keyboard user tabs to it and a screen reader announces it. The
   accessible name is the visible label; the mark is `aria-hidden` and `alt=""`. */
.sso-button:focus-visible {
    outline: 2px solid var(--ssn-other-focus-ring);
    outline-offset: 2px;
}

.sso-button__mark {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

/* Apple's HIG: black with white text. The white-on-dark variant is NOT built — the only
   theme that shows this button is the light Scrawlr one (`pages._BUTTON_THEMES`), and
   dead CSS for an unreachable case is worse than its absence. */
.sso-button--apple {
    background: #000;
    color: #fff;
}

.sso-button--apple:hover {
    background: #1a1a1a;
}

.sso-button--google {
    background: #fff;
    color: var(--ssn-grey-900, #212529);
    border-color: var(--ssn-grey-400, #CED4DA);
}

.sso-button--google:hover {
    background: var(--ssn-button-fill-white-hover);
}
