

.dashboard-user-layout .btn-counter-account-edit {
    color: var(--dashboard-primary-button-bg, var(--main-color, var(--front-color-primary)));
    background: rgba(var(--front-color-primary-rgb), 0.08);
    border-color: rgba(var(--front-color-primary-rgb), 0.18);
    box-shadow: none;
}

.dashboard-user-layout .btn-counter-account-edit:hover,
.dashboard-user-layout .btn-counter-account-edit:focus {
    color: var(--front-color-white);
    background: var(--dashboard-primary-button-bg, var(--main-color, var(--front-color-primary)));
    border-color: var(--dashboard-primary-button-bg, var(--main-color, var(--front-color-primary)));
}

.dashboard-user-layout .btn-counter-account-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    min-height: 2.25rem;
    padding-inline: 0.85rem;
    border-radius: 8px;
    font-weight: 800;
    text-transform: none;
}

.auth-shell {
    min-height: 100vh;
    width: 100%;
    padding: 1.6rem 1rem;
    position: relative;
    
    background:
        radial-gradient(circle at 20% 10%, rgba(var(--front-color-primary-rgb), 0.08), transparent 40%),
        radial-gradient(circle at 80% 90%, rgba(var(--front-color-alt-rgb), 0.07), transparent 40%),
        var(--front-color-bg);
}

/* Centered card on every shell — works in both flex and block modes */
.auth-shell > .auth-card {
    margin-left: auto;
    margin-right: auto;
}

/* Short pages: flex-centered vertically + horizontally */
.auth-shell:not(.is-long) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Long pages (registration): plain block layout — body grows, page scrolls */
.auth-shell.is-long {
    display: block;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

@media (min-width: 768px) {
    .auth-shell.is-long {
        padding-top: 2.2rem;
        padding-bottom: 2.2rem;
    }
}

/* Mobile-app feel under 576px */
@media (max-width: 575.98px) {
    .auth-shell {
        padding: 0.75rem 0.65rem;
    }

    .auth-shell:not(.is-long) {
        justify-content: flex-start;
    }

    .auth-shell.is-long {
        padding-top: 0.85rem;
        padding-bottom: 1rem;
    }
}

/* ===================================================================
 * 5. Premium auth card (mobile app feel on small, contained on desktop)
 * =================================================================*/
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--front-color-card);
    border: 1px solid var(--front-color-border);
    border-radius: 18px;
    box-shadow: 0 16px 42px -28px rgba(var(--front-color-black-rgb), 0.22);
    padding: 1.5rem 1.45rem 1.45rem;
    position: relative;
    overflow: hidden;
}

.auth-card.is-wide { max-width: 558px; }
.auth-card.is-x-wide { max-width: 720px; }

@media (max-width: 575.98px) {
    .auth-card {
        border-radius: 15px;
        padding: 1.1rem 0.95rem;
    }
}

/* Top brand stripe — picks up role accent via .is-* modifier */
.auth-card.has-accent::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    pointer-events: none;
}

.auth-card.has-accent.is-user::before {
    background: var(--front-gradient-user);
}
/* Auth header block */
.auth-card .auth-head {
    align-items: center;
    display: flex;
    flex-direction: column;
    text-align: center;
    margin-bottom: 1.1rem;
    padding-top: 0.05rem;
}

.auth-card .auth-head .auth-logo {
    display: block;
    height: 40px;
    max-height: 40px;
    max-width: 40px;
    object-fit: cover;
    object-position: left center;
    width: 40px;
    margin: 0 auto 0.5rem;
}

.auth-card .auth-head .auth-title {
    font-size: var(--front-font-xl);
    font-weight: 800;
    margin: 0 0 0.22rem;
    color: var(--front-color-heading);
    letter-spacing: 0;
}
.auth-card.is-user .auth-head .auth-title {
    color: var(--front-color-user);
}
.auth-card .auth-head .auth-subtitle {
    font-size: var(--front-font-sm);
    color: var(--front-color-muted);
    margin: 0 0 0.65rem;
    line-height: 1.45;
}

/* Auth role badge — pill */
.auth-card .auth-head .auth-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    padding: 0.3rem 0.72rem;
    border-radius: 999px;
    font-size: var(--front-font-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
}

@media (max-width: 575.98px) {
    .auth-card .auth-head {
        margin-bottom: 1rem;
        padding-top: 0.12rem;
    }

    .auth-card .auth-head .auth-logo {
        height: 38px;
        max-height: 38px;
        max-width: 38px;
        width: 38px;
        margin-bottom: 0.45rem;
    }

    .auth-card .auth-head .auth-title {
        line-height: 1.25;
        margin-bottom: 0.25rem;
    }
}

.auth-role-badge.is-user {
    color: var(--front-color-user);
    background: rgba(var(--front-color-user-rgb), 0.1);
    border: 1px solid rgba(var(--front-color-user-rgb), 0.2);
}
/* Form polish inside auth card — softer corners, premium focus */
.auth-card .form-control,
.auth-card .form-select,
.auth-card .input-group-text {
    min-height: 42px;
    border-radius: 9px;
    border-color: var(--front-color-border);
    font-size: var(--front-font-base);
}

.auth-card .form-control,
.auth-card .form-select {
    padding: 0.52rem 0.72rem;
}

.auth-card .form-label {
    color: var(--front-color-heading);
    font-size: var(--front-font-base);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.42rem;
}

.auth-card .mb-3 {
    margin-bottom: 0.85rem !important;
}

.auth-card .my-3 {
    margin-top: 0.68rem !important;
    margin-bottom: 0.82rem !important;
}

.auth-card .row.g-3 {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 0.82rem;
}

.auth-card .input-group > .form-control,
.auth-card .input-group > .form-select {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.auth-card .input-group > .input-group-text:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    background: var(--front-color-surface);
    justify-content: center;
    min-width: 38px;
    padding-left: 0.62rem;
    padding-right: 0.62rem;
}

.auth-card .input-group > .input-group-text:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.auth-card .form-control:focus,
.auth-card .form-select:focus {
    box-shadow: 0 0 0 0.14rem rgba(var(--front-color-user-rgb), 0.14);
    border-color: var(--front-color-user);
}
/* Section heading inside auth card (e.g. "Personal Information") */
.auth-card .auth-section-heading {
    font-size: var(--front-font-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--front-color-muted);
    margin: 0.35rem 0 0.65rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--front-color-border-soft);
}
/* Submit button stretches full width inside auth card — standard height */
.auth-card .btn-submit-auth {
    width: 100%;
    min-height: 40px;
    border-radius: 9px;
    padding: 0.45rem 1rem;
    font-size: var(--front-font-base);
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.35;
    box-shadow: 0 7px 18px -14px rgba(var(--front-color-black-rgb), 0.5);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.auth-card .btn-submit-auth:hover {
    transform: none;
    filter: brightness(1.04);
    box-shadow: 0 8px 18px -15px rgba(var(--front-color-black-rgb), 0.45);
}

.auth-card .btn-submit-auth.mt-4 {
    margin-top: 1rem !important;
}

.auth-card.is-user .btn-primary,
.auth-card.is-user .btn-submit-auth {
    background: var(--front-gradient-user);
    border-color: var(--front-color-user);
    color: var(--front-color-white);
    box-shadow: var(--front-shadow-user);
}

.auth-card.is-user .btn-primary:hover,
.auth-card.is-user .btn-submit-auth:hover {
    background: var(--front-color-user-hover);
    border-color: var(--front-color-user-hover);
    color: var(--front-color-white);
}

.auth-card.is-user .text-primary {
    color: var(--front-color-user) !important;
}
/* Auth divider line + helper text */
.auth-card .auth-divider {
    border-top: 1px solid var(--front-color-border-soft);
    margin: 0.9rem 0 0.68rem;
}

.auth-card .auth-helper-text {
    text-align: center;
    color: var(--front-color-muted);
    font-size: var(--front-font-xs);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.48rem;
}

.auth-card > p.text-center {
    color: var(--front-color-text);
    font-size: var(--front-font-base);
    line-height: 1.4;
    margin-top: 1rem !important;
    margin-bottom: 0.55rem !important;
}

/* ===================================================================
 * 6. Premium portal switch — compact segmented pill
 *    (Three connected pills inside one rounded container.)
 * =================================================================*/
.auth-portal-switch {
    display: flex;
    background: var(--front-color-surface);
    border: 1px solid var(--front-color-border);
    border-radius: 999px;
    padding: 0.22rem;
    gap: 0.18rem;
}

.auth-portal-switch .portal-tile {
    flex: 1 1 33%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.32rem;
    min-height: 34px;
    padding: 0.38rem 0.45rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--front-color-muted);
    background: transparent;
    border: 0;
    font-weight: 600;
    font-size: var(--front-font-xs);
    letter-spacing: 0.01em;
    transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.auth-portal-switch .portal-tile i {
    font-size: var(--front-font-base);
    line-height: 1;
}

.auth-portal-switch .portal-tile:hover {
    color: var(--front-color-text);
    background: var(--front-color-card);
}

/* Active states pick up role color */
.auth-portal-switch .portal-tile.is-user.is-active {
    background: var(--front-gradient-user);
    color: var(--front-color-white);
    box-shadow: 0 5px 12px -8px rgba(var(--front-color-user-rgb), 0.48);
    transform: none;
}
/* On very small phones use shorter labels — handled by HTML d-sm-inline + d-inline d-sm-none switches */
@media (max-width: 575.98px) {
    .auth-portal-switch {
        padding: 0.18rem;
    }

    .auth-portal-switch .portal-tile {
        min-height: 32px;
        padding: 0.36rem 0.3rem;
        font-size: var(--front-font-2xs);
        gap: 0.26rem;
    }

    .auth-portal-switch .portal-tile i {
        font-size: var(--front-font-sm);
    }
}

/* ===================================================================
 * 9. Hide-on-mobile / show-on-mobile portal labels (for ultra compact)
 * =================================================================*/
.auth-portal-switch .label-full { display: inline; }
.auth-portal-switch .label-short { display: none; }

@media (max-width: 359.98px) {
    .auth-portal-switch .label-full { display: none; }
    .auth-portal-switch .label-short { display: inline; }
}

/* ===================================================================
 * 10. Scroll safety net for auth pages
 *
 *     If any ancestor (theme reset, custom DB-loaded CSS, plugin styles)
 *     accidentally locks the auth-content div to viewport height or
 *     hidden overflow, scroll on long pages dies. The rules below force
 *     the auth wrapper chain back into normal block flow with visible
 *     overflow so the document body can grow with content. The
 *     `body > .auth-content` selector keeps specificity scoped to the
 *     auth-only layout so dashboard pages are not affected.
 * =================================================================*/
body > .auth-content {
    display: block;
    width: 100%;
    min-height: 100vh;
    height: auto;
    overflow: visible;
    position: static;
}

body > .auth-content > .auth-shell {
    height: auto;
    overflow: visible;
}

body > .auth-content > .auth-shell.is-long {
    display: block;
    height: auto;
    overflow: visible;
}

html.frontend-auth-html {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

body.frontend-auth-layout {
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: auto;
}

