/* Identity uses the approved Nexo tokens and the existing tenant brand. */
.nexo-identity {
    background: var(--nexo-canvas);
    color: var(--nexo-text);
}

.nexo-identity .auth-shell,
.nexo-identity .account-shell,
.nexo-identity .message-shell {
    display: grid;
    width: 100%;
    max-width: none;
    min-height: 0;
    padding: clamp(1rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem);
    place-items: center;
}

.nexo-identity .auth-shell__backdrop { display: none; }

.nexo-identity .auth-card,
.nexo-identity .account-card,
.nexo-identity .message-card,
.nexo-identity .profile-configuration-pending__card,
.nexo-identity .commerce-activation__card,
.nexo-identity .profile-form,
.nexo-identity .profile-photo-card {
    min-width: 0;
    background: var(--nexo-surface);
    border: 1px solid var(--nexo-border);
    border-radius: 1rem;
    box-shadow: none;
    overflow-wrap: anywhere;
}

.nexo-identity .auth-card,
.nexo-identity .account-card,
.nexo-identity .message-card {
    width: min(100%, 36rem);
    padding: clamp(1.2rem, 4vw, 2.6rem);
}

.nexo-identity .nexo-identity__credentials > .auth-card {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    align-items: stretch;
    gap: 0;
    width: min(100%, 59rem);
    max-width: none;
    padding: 0;
    overflow: hidden;
}

.nexo-identity__credentials .auth-card__intro,
.nexo-identity__form-pane {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    margin: 0;
    padding: clamp(1.35rem, 4.4vw, 3.65rem);
}

.nexo-identity__credentials .auth-card__intro {
    align-items: start;
    text-align: start;
    background: var(--nexo-soft);
    border-inline-end: 1px solid var(--nexo-border);
}

.nexo-identity .nexo-identity__credentials .auth-card__title {
    margin: 0 0 .6rem;
    color: var(--nexo-text);
    font-size: clamp(1.8rem, 4.3vw, 3.5rem);
    line-height: 1.08;
    letter-spacing: -.045em;
}

.nexo-identity__credentials .auth-card__intro p {
    max-width: 27ch;
    color: var(--nexo-muted);
    line-height: 1.6;
}

.nexo-identity__credentials .auth-card__intro [data-login-slogan] {
    margin: 1rem 0 0;
    padding: .65rem 0 0;
    border-top: 1px solid var(--nexo-border);
    font-size: .875rem;
    font-weight: 700;
}

.nexo-identity .auth-form { gap: .85rem; }
.nexo-identity .auth-form__recovery { justify-self: start; padding-block: .35rem; }
.nexo-identity__form-pane > .auth-card__note {
    margin: 1rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--nexo-border);
}

.nexo-identity .tenant-login--compact > .auth-card {
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 39rem);
}

.tenant-login--compact .auth-card__intro {
    border-inline-end: 0;
    border-block-end: 1px solid var(--nexo-border);
    padding-block: clamp(1.35rem, 3vw, 2.2rem);
}

.tenant-login__logo {
    width: auto;
    height: auto;
    max-width: min(100%, var(--portal-logo-width, 10rem));
    max-height: var(--portal-logo-height, 3rem);
    margin-block-end: 1.25rem;
}

.tenant-login__image {
    width: 100%;
    max-height: 14rem;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    margin-block-start: 1rem;
    border-radius: .75rem;
}

.nexo-identity :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    min-width: 0;
    max-width: 100%;
    font-size: 1rem;
}

/* Tenant action backgrounds stay saturated in both color schemes. */
.nexo-identity .button--primary {
    --color-action-on-primary: var(--color-on-action, #fff);
}

.nexo-identity :is(.button, .ui-tab) {
    min-height: 44px;
    white-space: normal;
}

.nexo-identity :is(.auth-form__recovery, .auth-card__note a, .commerce-activation__recovery) {
    color: var(--nexo-text);
    text-decoration: underline;
    text-underline-offset: .18em;
}

.nexo-identity .commerce-activation {
    min-height: 0;
    padding-block: clamp(1rem, 5vw, 4rem);
}

.nexo-identity .commerce-activation__summary,
.nexo-identity .commerce-activation__action { min-width: 0; }
.nexo-identity .commerce-activation__summary { background: var(--nexo-soft); }
.nexo-identity .commerce-activation__summary h1 { font-size: clamp(1.85rem, 4vw, 3.5rem); }
.nexo-identity .commerce-activation__action { background: var(--nexo-surface); }

.nexo-identity .profile-shell {
    max-width: 63rem;
    padding: clamp(1rem, 4vw, 3rem) clamp(1rem, 3vw, 2rem) 3rem;
}

.nexo-identity .profile-heading { margin-bottom: 1.4rem; }
.nexo-identity .profile-heading p { color: var(--nexo-muted); }
.nexo-identity .profile-tabs .ui-tablist { display: flex; flex-wrap: wrap; }
.nexo-identity .profile-phone-field { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.nexo-identity .profile-photo-card__body { min-width: 0; }

@media (max-width: 720px) {
    .nexo-identity .nexo-identity__credentials > .auth-card { grid-template-columns: minmax(0, 1fr); max-width: 30rem; }
    .nexo-identity__credentials .auth-card__intro {
        border-inline-end: 0;
        border-block-end: 1px solid var(--nexo-border);
    }
    .nexo-identity__credentials .auth-card__intro p { max-width: none; }
    .nexo-identity .profile-phone-field,
    .nexo-identity .profile-photo-card { grid-template-columns: minmax(0, 1fr); }
}

.nexo-identity .auth-shell[data-editor-block] { inline-size: 100%; }
.tenant-login__logo { object-fit: contain; object-position: left center; }
.tenant-login__image { object-fit: contain; }

[data-portal-login].portal-option-spacing-compact .auth-card__intro { padding: 1rem; }
[data-portal-login].portal-option-spacing-spacious .auth-card__intro { padding: clamp(1.5rem, 4vw, 3rem); }
[data-portal-login].portal-option-margin-compact { margin-block: 0; }
[data-portal-login].portal-option-margin-spacious { margin-block: 2rem; }
[data-portal-login].portal-option-surface-dark .auth-card__intro {
    background: #152439;
    color: #f8fafc;
    --nexo-text: #f8fafc;
    --nexo-muted: #e2e8f0;
    --nexo-surface: #23344c;
}
[data-portal-login].portal-option-surface-dark .auth-card__intro > :is(h1,p) { color: #f8fafc; }
.nexo-identity [data-portal-login] .auth-card__intro .portal-option-titlescale-small { font-size: clamp(1.2rem, 2.4vw, 1.9rem); }
.nexo-identity [data-portal-login] .auth-card__intro .portal-option-titlescale-large { font-size: clamp(2.2rem, 5vw, 4rem); }
[data-portal-login].portal-option-alignment-start .auth-card__intro { justify-content: start; }
[data-portal-login].portal-option-alignment-center .auth-card__intro { justify-content: center; }
[data-portal-login].portal-option-alignment-end .auth-card__intro { justify-content: end; }
[data-portal-login].portal-option-gap-compact .auth-card__intro { gap: .75rem; }
[data-portal-login].portal-option-gap-spacious .auth-card__intro { gap: 2rem; }
[data-portal-login].portal-option-surface-soft .auth-card__intro { background: var(--nexo-surface); }
@media (min-width: 760px) {
    .nexo-identity [data-portal-login]:not(.tenant-login--compact).portal-option-columns-balanced .auth-card { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
    .nexo-identity [data-portal-login]:not(.tenant-login--compact).portal-option-columns-copywide .auth-card { grid-template-columns: minmax(0,3fr) minmax(0,2fr); }
    .nexo-identity [data-portal-login]:not(.tenant-login--compact).portal-option-columns-imagewide .auth-card { grid-template-columns: minmax(0,2fr) minmax(0,3fr); }
}

:is([data-portal-login], [data-portal-structure]) .portal-option-logosize-small { --portal-logo-width: 6rem; --portal-logo-height: 2rem; }
:is([data-portal-login], [data-portal-structure]) .portal-option-logosize-large { --portal-logo-width: 13rem; --portal-logo-height: 4rem; }
:is([data-portal-login], [data-portal-structure]) .portal-option-logoalign-start { align-self: start; margin-inline: 0 auto; }
:is([data-portal-login], [data-portal-structure]) .portal-option-logoalign-center { align-self: center; margin-inline: auto; }
:is([data-portal-login], [data-portal-structure]) .portal-option-logoalign-end { align-self: end; margin-inline: auto 0; }
:is([data-portal-login], [data-portal-structure]) .portal-option-logofit-cover { object-fit: cover; }
:is([data-portal-login], [data-portal-structure]) .portal-option-logofocus-start { object-position: 25% 25%; }
:is([data-portal-login], [data-portal-structure]) .portal-option-logofocus-end { object-position: 75% 75%; }
:is([data-portal-login], [data-portal-structure]) .portal-option-logocorners-rounded { border-radius: .75rem; }
:is([data-portal-login], [data-portal-structure]) .portal-option-logoratio-square { aspect-ratio: 1; width: min(100%, var(--portal-logo-height, 3rem)); }
:is([data-portal-login], [data-portal-structure]) .portal-option-logoratio-landscape { aspect-ratio: 3 / 1; width: min(100%, calc(3 * var(--portal-logo-height, 3rem))); }

/* Explicit framing keeps its ratio at every available width. */
[data-portal-login] .tenant-login__image:is(.portal-option-imageratio-square, .portal-option-imageratio-landscape, .portal-option-imageratio-portrait) {
    max-height: none;
}
