.auth-body {
    min-height: 100svh;
    background: var(--page-bg);
}

.auth-shell {
    display: grid;
    min-height: 100svh;
    place-items: center;
    padding: clamp(1rem, 4vw, 3rem);
}

.auth-card {
    width: min(100%, 460px);
    padding: clamp(1rem, 4vw, 1.5rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.account-card {
    width: min(100%, 560px);
}

.auth-brand {
    margin-bottom: 2rem;
}

.auth-heading {
    margin-bottom: 1.25rem;
}

.auth-heading .eyebrow {
    margin-bottom: 0.85rem;
}

.auth-heading h1 {
    max-width: none;
    margin-bottom: 0.65rem;
    font-size: clamp(1.8rem, 6vw, 2.5rem);
    line-height: 1;
}

.auth-heading p {
    margin-bottom: 0;
    color: var(--muted);
}

.auth-form {
    display: grid;
    gap: 1rem;
}

.auth-form .button,
.auth-provider-stack .button {
    width: 100%;
}

.auth-provider-stack {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.button.microsoft {
    color: #fff;
    background: #1f2937;
    border-color: #1f2937;
}

.button.microsoft:hover {
    background: #111827;
}

.button.microsoft.disabled,
.button.microsoft:disabled {
    color: #64748b;
    cursor: not-allowed;
    background: #e2e8f0;
    border-color: #cbd5e1;
    box-shadow: none;
    transform: none;
}

.auth-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem;
    align-items: center;
    margin: 1rem 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
    height: 1px;
    content: "";
    background: var(--line);
}

.auth-check {
    background: var(--surface-raised);
}

.auth-alert {
    margin-bottom: 1rem;
    padding: 0.8rem;
    color: #991b1b;
    font-weight: 700;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-small);
}

.auth-alert.success {
    color: #166534;
    background: #dcfce7;
    border-color: #bbf7d0;
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
}

.auth-link {
    color: var(--blue-dark);
    font-weight: 800;
    text-decoration: none;
}

.auth-link:hover,
.auth-link:focus-visible {
    text-decoration: underline;
}

.session-list {
    display: grid;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
}

.session-list div {
    display: grid;
    grid-template-columns: 9rem minmax(0, 1fr);
    gap: 1rem;
    padding: 0.8rem;
    background: var(--surface-raised);
    border: 1px solid #e1e8f0;
    border-radius: var(--radius-small);
}

.session-list dt {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.session-list dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.profile-brand {
    margin-bottom: 1.25rem;
}

.profile-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.profile-photo {
    width: 4.25rem;
    height: 4.25rem;
    object-fit: cover;
    background: var(--surface-raised);
    border: 1px solid var(--line);
    border-radius: 50%;
    box-shadow: 0 14px 30px rgb(15 23 42 / 12%);
}

.profile-heading {
    min-width: 0;
    margin-bottom: 0;
}

.profile-heading h1 {
    font-size: clamp(1.45rem, 4vw, 2rem);
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.profile-dialog {
    width: min(calc(100% - 1rem), 560px);
    max-height: min(92vh, 680px);
}

.profile-dialog .dialog-panel {
    max-height: min(92vh, 680px);
}

.profile-dialog .dialog-body {
    padding: 0.9rem;
}

.profile-dialog .profile-brand {
    display: none;
}

.profile-dialog .profile-summary {
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.profile-dialog .profile-photo {
    width: 3rem;
    height: 3rem;
    box-shadow: 0 10px 22px rgb(15 23 42 / 10%);
}

.profile-dialog .profile-heading h1 {
    margin-bottom: 0.25rem;
    font-size: 1.3rem;
}

.profile-dialog .profile-heading p,
.profile-dialog .profile-heading .eyebrow {
    margin-bottom: 0;
}

.profile-dialog .session-list {
    gap: 0.55rem;
    margin-bottom: 0.85rem;
}

.profile-dialog .session-list div {
    grid-template-columns: 7rem minmax(0, 1fr);
    gap: 0.65rem;
    padding: 0.6rem;
}

.profile-dialog .profile-theme-form,
.profile-dialog .profile-photo-form {
    flex: 1 1 16rem;
    margin-bottom: 0;
}

.profile-theme-form,
.profile-photo-form {
    margin-bottom: 1rem;
    padding: 0.85rem;
    background: var(--surface-raised);
    border: 1px solid #e1e8f0;
    border-radius: var(--radius-small);
}

.profile-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.profile-inline-form {
    display: inline-flex;
}

.profile-action-row .button {
    width: auto;
}

@media (max-width: 520px) {
    .auth-shell {
        align-items: start;
        padding-top: 1rem;
    }

    .session-list div {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .profile-summary {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .profile-action-row,
    .profile-inline-form,
    .profile-action-row .button {
        width: 100%;
    }

    .profile-photo {
        width: 3.5rem;
        height: 3.5rem;
    }

    .profile-dialog .session-list div {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }
}
