:root {
    color-scheme: light;
    --page-background: #ffffff;
    --panel-background: #ffffff;
    --panel-border: rgba(0, 0, 0, 0.08);
    --text-strong: #202020;
    --text-muted: #6f6f6f;
    --accent: #d3072a;
    --accent-hover: #d3072a;
    --error-background: transparent;
    --error-text: #d3072a;
    --input-border: #999999;
    --input-focus-border: #333333;
    --input-focus-shadow: rgba(0, 73, 193, 0.263);
    --step-transition-duration: 240ms;
    --step-transition-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html.enhanced-login [data-step-stage] {
    position: relative;
    transition: height var(--step-transition-duration) var(--step-transition-ease);
}

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 0;
    background: var(--page-background);
    color: var(--text-strong);
    font-family: "Roboto", sans-serif;
}

.shell {
    width: min(100%, 420px);
    min-height: 100vh;
    padding: 44px 16px 40px;
    background: var(--panel-background);
}

.auth-panel {
    width: 100%;
}

h1 {
    margin: 0;
}

.brand {
    display: grid;
    justify-items: center;
    gap: 18px;
    margin-bottom: 34px;
    transition: gap var(--step-transition-duration) var(--step-transition-ease), margin-bottom var(--step-transition-duration) var(--step-transition-ease);
}

.brand--compact {
    gap: 0;
    margin-bottom: 28px;
}

.welcome-title {
    font-family: "x4Rfaw", "Roboto", sans-serif;
    font-size: var(--identity-script-heading-size, clamp(2.4rem, 8vw, 3rem));
    font-weight: 400;
    line-height: 1;
    color: var(--accent);
    text-align: center;
    max-height: 80px;
    overflow: hidden;
    opacity: 1;
    transform: translateY(0);
    transition: opacity var(--step-transition-duration) var(--step-transition-ease), transform var(--step-transition-duration) var(--step-transition-ease), max-height var(--step-transition-duration) var(--step-transition-ease), margin var(--step-transition-duration) var(--step-transition-ease);
}

    .welcome-title.is-hidden {
        max-height: 0;
        margin: 0;
        opacity: 0;
        transform: translateY(-6px);
        pointer-events: none;
    }

.section-label {
    margin: 0 0 18px;
    color: var(--text-strong);
    font-size: 1rem;
    line-height: 1.4;
    text-align: center;
}

.sign-in-context {
    margin: 0 0 30px;
    text-align: center;
}

.context-kicker {
    margin: 0 0 8px;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.35;
}

.context-username {
    margin: 0;
    color: var(--text-strong);
    font-size: clamp(1.15rem, 4.8vw, 1.35rem);
    font-weight: 500;
    line-height: 1.25;
    word-break: break-word;
}

.method-question {
    margin: 0 0 10px;
    color: #111111;
    font-size: clamp(1.1rem, 5vw, 1.3rem);
    font-weight: 400;
    line-height: 1.35;
}

#login-form[data-password-confirmation="true"] .password-step-header {
    text-align: center;
}

#login-form[data-password-confirmation="true"] .method-question {
    color: var(--accent);
    font-family: "x4Rfaw", "Roboto", sans-serif;
    font-size: 56px;
    line-height: 45px;
}

.validation-summary-errors {
    margin: 14px 0 30px;
    padding: 0;
    border: 0;
    background: var(--error-background);
    color: var(--error-text);
    font-size: 0.98rem;
}

    .validation-summary-errors li {
        margin-bottom: 10px;
    }

        .validation-summary-errors li:last-child {
            margin-bottom: 0;
        }

.field {
    margin-bottom: 18px;
}

    .field:last-child {
        margin-bottom: 0;
    }

.step-stage {
    position: relative;
    overflow: clip;
    contain: layout paint;
}

[data-step] {
    display: none;
    position: relative;
    width: 100%;
}

    [data-step].is-active,
    html.enhanced-login [data-step].is-entering,
    html.enhanced-login [data-step].is-leaving,
    html.enhanced-login [data-step].is-measuring {
        display: block;
    }

    html.enhanced-login [data-step].is-entering,
    html.enhanced-login [data-step].is-leaving,
    html.enhanced-login [data-step].is-measuring {
        position: absolute;
        inset: 0;
    }

    html.enhanced-login [data-step].is-measuring {
        visibility: hidden;
        pointer-events: none;
    }

@keyframes step-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes step-leave {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-6px);
    }
}

html.enhanced-login [data-step].is-entering {
    animation: step-enter var(--step-transition-duration) var(--step-transition-ease) both;
}

html.enhanced-login [data-step].is-leaving {
    pointer-events: none;
    animation: step-leave var(--step-transition-duration) var(--step-transition-ease) both;
}

.floating-field--with-toggle input[type="password"],
.floating-field--with-toggle input[type="text"] {
    padding-right: 56px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.94rem;
    font-weight: 700;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    padding: 24px 16px 10px;
    font: inherit;
    color: var(--text-strong);
    background: #fff;
    transition: border-color 140ms ease, box-shadow 140ms ease;
    font-size: 1rem;
}

input::placeholder {
    color: transparent;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--input-border) var(--input-border) var(--input-focus-border);
    box-shadow: 0 0 4px -1px var(--input-focus-shadow);
}

.password-visibility-toggle {
    right: 12px;
}

.step-actions,
.password-actions {
    display: grid;
    gap: 16px;
}

.desktop-only {
    display: none;
}

.identifier-desktop-copy {
    margin-bottom: 16px;
}

.identifier-heading {
    margin: 0 0 32px;
    color: var(--accent);
    font-family: "x4Rfaw", "Roboto", sans-serif;
    font-size: var(--identity-script-heading-size, 4.5rem);
    font-weight: 400;
    line-height: 0.8;
    letter-spacing: 0;
    text-align: center;
    white-space: nowrap;
}

.identifier-field-label {
    margin: 0;
    color: #111111;
    font-size: 0.98rem;
    font-weight: 400;
    line-height: 1.35;
    text-align: left;
}

.identifier-app-label {
    margin: 0 0 12px;
    color: #111111;
    font-size: 0.98rem;
    font-weight: 400;
    line-height: 1.35;
    text-align: left;
}

.identifier-support-link {
    display: inline-block;
    width: auto;
    margin: 8px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #3a3a3a;
    font: inherit;
    font-size: 0.98rem;
    font-weight: 400;
    line-height: 1.35;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: default;
}

    .identifier-support-link:hover,
    .identifier-support-link:focus {
        background: transparent;
        color: #3a3a3a;
        transform: none;
        box-shadow: none;
    }

.identifier-signup {
    margin-top: 16px;
    padding-bottom: 14px;
    text-align: center;
}

.group-card-cta {
    margin-top: 16px;
    margin-bottom: 18px;
    text-align: center;
}

.group-card-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: auto;
    min-height: 0;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.35;
    user-select: none;
    -webkit-user-select: none;
}

    .group-card-button:hover,
    .group-card-button:focus {
        background: transparent;
        color: var(--accent);
        transform: none;
        box-shadow: none;
    }

    .group-card-button span {
        flex: 0 1 auto;
        text-align: center;
    }

    .group-card-button img {
        width: 24px;
        height: 24px;
        flex: 0 0 auto;
    }

.identifier-signup-links {
    display: grid;
    gap: 16px;
}

body.identity-page--app .identifier-signup-links {
    gap: 10px;
}

.identifier-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 18px;
    padding: 6px 0;
    color: #4a4a4a;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1;
    text-transform: none;
}

    .identifier-divider::before,
    .identifier-divider::after {
        content: "";
        flex: 1 1 auto;
        height: 1px;
        background: #d8d8d8;
    }

.identifier-signup-copy {
    margin: 0 0 16px;
    color: var(--accent);
    font-size: 0.98rem;
    font-weight: 400;
    line-height: 1.35;
}

.outline-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: 1px solid var(--accent);
    border-radius: 4px;
    padding: 15px 18px;
    background: transparent;
    color: var(--accent);
    text-decoration: none;
    font-weight: 400;
    user-select: none;
    -webkit-user-select: none;
}

    .outline-button:hover,
    .outline-button:focus {
        background: transparent;
        color: var(--accent);
        transform: none;
        box-shadow: none;
    }

.secondary-button {
    color: #fff;
    background: var(--accent);
}

.password-step-header {
    margin-bottom: 6px;
}

.change-email-link {
    display: inline-block;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #222222;
    font: inherit;
    font-size: 0.98rem;
    font-weight: 400;
    line-height: 1.35;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    transition: none;
    user-select: none;
    -webkit-user-select: none;
}

    .change-email-link:focus,
    .change-email-link:hover,
    .change-email-link:active {
        background: transparent;
        border: 0;
        color: #222222;
        transform: none;
        box-shadow: none;
    }

    .change-email-link:focus-visible {
        outline: 3px solid rgba(0, 73, 193, 0.22);
        outline-offset: 2px;
    }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-weight: 400;
    text-decoration: underline;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

    .back-link:hover,
    .back-link:focus,
    .back-link:active {
        color: var(--accent-hover);
        transform: none;
    }

.account-summary {
    margin: 0 0 8px;
    word-break: break-word;
}

.password-choice-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 13px 0 0;
    color: #4a4a4a;
    font-size: 0.98rem;
    font-weight: 400;
    line-height: 1;
}

    .password-choice-divider[hidden] {
        display: none;
    }

    .password-choice-divider::before,
    .password-choice-divider::after {
        content: "";
        flex: 1 1 auto;
        height: 1px;
        background: #d8d8d8;
    }

.code-sign-in-option {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.code-sign-in-copy {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.4;
    text-align: left;
}

.password-panel {
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: max-height 280ms var(--step-transition-ease), opacity 200ms ease, transform 240ms var(--step-transition-ease);
}

    .password-panel.is-visible {
        max-height: 420px;
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .password-step-summary.validation-summary-errors {
        margin: 12px 0 18px;
    }

.password-help-link {
    display: inline-block;
    margin-top: 14px;
    color: #222222;
    font-size: 0.98rem;
    font-weight: 400;
    line-height: 1.35;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

    .password-help-link:hover,
    .password-help-link:focus,
    .password-help-link:active {
        color: #222222;
    }

.outline-button::selection,
.group-card-button::selection,
.change-email-link::selection,
.back-link::selection,
.password-help-link::selection {
    background: transparent;
    color: inherit;
}

button,
.password-actions a {
    width: 100%;
    border: 0;
    border-radius: 4px;
    padding: 15px 18px;
    font: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    background: var(--accent);
    cursor: pointer;
    transition: background-color 140ms ease;
}

    button:hover,
    .password-actions a:hover {
        background: var(--accent-hover);
    }

    button:focus-visible,
    .password-actions a:focus-visible {
        outline: 3px solid rgba(0, 73, 193, 0.22);
        outline-offset: 2px;
    }

    button:disabled {
        background: var(--accent);
        cursor: wait;
        opacity: 1;
    }

    button:disabled:hover {
        background: var(--accent-hover);
    }

    button.password-visibility-toggle:disabled,
    button.password-visibility-toggle:disabled:hover {
        background: transparent;
        color: #4e4e4e;
        opacity: 1;
    }

    button.change-email-link:disabled,
    button.change-email-link:disabled:hover {
        background: transparent;
        color: #222222;
        opacity: 1;
    }

    button.back-link:disabled,
    button.back-link:disabled:hover {
        background: transparent;
        color: var(--accent);
        opacity: 1;
    }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (max-width: 767px) {
    body.identity-page--app .shell {
        padding: 20px 16px 36px;
    }

    body.identity-page--app .brand {
        position: sticky;
        top: 0;
        z-index: 1;
        align-content: start;
        margin-bottom: 24px;
        padding-top: 10px;
        background: var(--panel-background);
    }

    body.identity-page--app .brand--compact {
        margin-bottom: 24px;
    }

    body.identity-page--app .method-question {
        margin-bottom: 18px;
    }

    body.identity-page--web .shell {
        padding: 20px 24px 24px;
    }

    body.identity-page--web .brand {
        position: relative;
        gap: 0;
        margin-bottom: 0;
        padding-top: 0;
        background: var(--panel-background);
    }

    body.identity-page--web .brand::after {
        content: "";
        display: block;
        width: 100%;
        height: 1px;
        margin: 16px auto 0;
        background: #e9dfdc;
    }

    body.identity-page--web .welcome-title {
        display: none;
    }

    body.identity-page--web .desktop-only {
        display: block;
    }

    body.identity-page--web [data-step="identifier"] {
        padding-top: 24px;
    }

    body.identity-page--web .identifier-heading {
        margin-bottom: 32px;
        font-size: var(--identity-script-heading-size, 3.5rem);
    }

    body.identity-page--web [data-step="identifier"] .field {
        margin-bottom: 14px;
    }

    body.identity-page--web [data-step="identifier"] .validation-summary-errors {
        margin: 10px 0 8px;
    }

    body.identity-page--web [data-step="identifier"] .step-actions {
        margin-top: 32px;
    }

    body.identity-page--web [data-step="identifier"] .step-actions button,
    body.identity-page--web .identifier-signup.desktop-only,
    body.identity-page--web [data-step="identifier"] .group-card-cta.desktop-only {
        width: 100%;
    }

    body.identity-page--web [data-step="identifier"] .group-card-cta.desktop-only {
        margin-top: 16px;
        margin-bottom: 18px;
    }

    body.identity-page--web .identifier-signup.desktop-only {
        margin-top: 0;
        padding-bottom: 0;
    }

    body.identity-page--web .identifier-signup.desktop-only .identifier-signup-links {
        gap: 11px;
    }

    body.identity-page--web [data-step="password"] {
        padding-top: 24px;
    }
}

@media (min-width: 768px) {
    body.identity-page--web {
        place-items: start center;
        padding: 32px 24px;
        background: linear-gradient(180deg, #f8dfe3 0%, #f9ecee 100%);
    }

    body.identity-page--web .shell {
        width: min(100%, 544px);
        min-height: auto;
        padding: 0 0 24px;
        overflow: hidden;
        border: 0;
        border-radius: 28px;
        box-shadow: 0 18px 60px rgba(0, 0, 0, 0.1);
    }

    body.identity-page--web .auth-panel {
        width: 100%;
    }

    body.identity-page--web .brand {
        gap: 0;
        margin-bottom: 0;
        padding: 16px 0 0;
        position: relative;
    }

    body.identity-page--web .brand::after {
        content: "";
        display: block;
        width: calc(100% - 128px);
        margin: 16px auto 0;
        height: 1px;
        background: #e9dfdc;
    }

    body.identity-page--web .welcome-title {
        display: none;
    }

    body.identity-page--web .desktop-only {
        display: block;
    }

    body.identity-page--web [data-step="identifier"] {
        padding: 24px 64px 0;
    }

    body.identity-page--web [data-step="identifier"] .field {
        margin-bottom: 14px;
    }

    body.identity-page--web [data-step="identifier"] .validation-summary-errors {
        margin: 10px 0 8px;
    }

    body.identity-page--web [data-step="identifier"] .step-actions {
        justify-items: center;
        margin-top: 32px;
    }

    body.identity-page--web [data-step="identifier"] .step-actions button {
        width: min(100%, 260px);
        height: 54px;
        padding: 0 18px;
    }

    body.identity-page--web [data-step="identifier"] .group-card-cta.desktop-only,
    body.identity-page--web .identifier-signup.desktop-only {
        width: min(100%, 260px);
        margin-right: auto;
        margin-left: auto;
    }

    body.identity-page--web [data-step="identifier"] .group-card-cta.desktop-only {
        margin-top: 24px;
        margin-bottom: 24px;
    }

    body.identity-page--web .identifier-signup.desktop-only {
        margin-top: 0;
        padding-bottom: 0;
    }

    body.identity-page--web .identifier-signup.desktop-only .outline-button {
        width: 100%;
        height: 54px;
        padding: 0 18px;
    }

    body.identity-page--web .identifier-signup.desktop-only .identifier-signup-links {
        gap: 11px;
        justify-items: center;
    }

    body.identity-page--web [data-step="identifier"] input[type="text"] {
        padding-top: 24px;
        padding-bottom: 10px;
    }

    body.identity-page--web [data-step="identifier"] .field-descriptor {
        top: 50%;
        font-size: 0.98rem;
        transform: translateY(-50%);
    }

    body.identity-page--web [data-step="identifier"] .floating-field.has-value .field-descriptor,
    body.identity-page--web [data-step="identifier"] .floating-field:focus-within .field-descriptor {
        top: 9px;
        font-size: 0.77rem;
    }

    body.identity-page--web [data-step="password"] {
        padding: 40px 64px 0;
    }

    body.identity-page--web [data-step="password"] .context-username,
    body.identity-page--web [data-step="password"] .method-question {
        font-size: 1.25rem;
    }

    body.identity-page--web [data-step="password"] .sign-in-context {
        padding-bottom: 11px;
    }

    body.identity-page--web [data-step="password"] .account-summary {
        margin-bottom: 11px;
        line-height: 1.35;
    }

    body.identity-page--web [data-step="password"] .change-email-link {
        line-height: 24px;
    }

    body.identity-page--web [data-step="password"] .password-actions a,
    body.identity-page--web [data-step="password"] .code-sign-in-option > button {
        height: 54px;
        padding: 0 18px;
    }
}

.password-actions a:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-decoration: none;
}
