/*
 * ==========================================================================
 * ArsLudi Account / Onboarding Flow
 * ==========================================================================
 *
 * Questo è l'unico foglio di comportamento specifico del funnel account.
 * Niente fix incrementali o min-height desktop storici: il viewport viene
 * gestito dalla shell e le pagine interne restano content-driven.
 */

@font-face {
    font-family: "ArsLudiAccountManrope";
    src: url("/fonts/manrope/manrope-variable.woff2") format("woff2");
    font-style: normal;
    font-weight: 200 800;
    font-display: block;
}

html {
    font-size: 16px;
}

.account-layout {
    font-family:
        "ArsLudiAccountManrope",
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

.account-layout__main {
    min-height: 0;
}

/*
 * AppRouter e CreateOrganization usavano ancora min-h-screen dentro una shell
 * che ha anche il footer. Il risultato era 100vh + footer => scrollbar.
 * La shell è la sola proprietaria dell'altezza viewport.
 */
.account-layout__main > section.min-h-screen {
    display: flex;
    min-height: 0 !important;
    flex: 1 1 auto;
}

.account-layout__main > section.min-h-screen > div.min-h-screen {
    min-height: 0 !important;
    flex: 1 1 auto;
}

.account-auth-frame {
    min-height: 0;
}

/*
 * Login desktop: stessa identità del Register, ma densità adeguata alla quantità
 * reale di contenuto. A 1280x900 footer e card devono stare nel viewport.
 */
#loginPage {
    min-height: 0;
}

#loginCard > section,
#loginCard > aside {
    padding-top: 1.55rem !important;
    padding-bottom: 1.55rem !important;
}

#loginCard > section > h1 {
    margin-top: 0.5rem !important;
}

#loginCard > section > p {
    margin-top: 0.65rem;
}

#loginCard form {
    margin-top: 1.15rem !important;
}

#loginCard form.space-y-5 > :not(:last-child) {
    margin-block-end: 0.7rem !important;
}

#loginCard [data-valmsg-for] {
    display: block;
    min-height: 1rem;
    margin-top: 0.25rem !important;
    line-height: 1rem;
}

#loginCard aside > .relative > p + h2 {
    margin-top: 0.5rem !important;
}

#loginCard aside > .relative > h2 + p {
    margin-top: 0.7rem !important;
}

#loginCard aside .mt-9.space-y-8 {
    margin-top: 1.25rem !important;
    row-gap: 0 !important;
}

#loginCard aside .mt-9.space-y-8 > :not(:last-child) {
    margin-block-end: 0.9rem !important;
}

#loginCard aside .mt-auto.pt-10 {
    padding-top: 1.25rem !important;
}

/*
 * Le form di onboarding già riservano spazio validation. Manteniamo stabile
 * anche la parte testuale lunga in DE/FR/ES senza fissare l'intera card.
 */
.account-layout__main [asp-validation-for],
.account-layout__main .field-validation-valid,
.account-layout__main .field-validation-error {
    min-height: 1rem;
}

@media (min-width: 1024px) {
    .account-layout__main > section.min-h-screen > div.min-h-screen > div.flex-1 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
}

@media (max-width: 1023.98px) {
    #loginCard > section,
    #loginCard > aside {
        padding-top: 1.75rem !important;
        padding-bottom: 1.75rem !important;
    }

    /*
     * Profile mobile/tablet:
     * la shell globale è già proprietaria dello scroll di #tenantMainContent.
     * Evitiamo quindi un secondo scroll-root annidato nel profilo, che su
     * viewport touch può lasciare la pagina apparentemente bloccata.
     */
    #account-profile-page {
        height: auto !important;
        min-height: 100%;
        overflow: visible !important;
    }

    #account-profile-edit-form {
        min-height: auto !important;
        flex: none !important;
        overflow: visible !important;
    }

    #account-profile-edit-form > main {
        min-height: auto !important;
        flex: none !important;
        overflow: visible !important;
        overscroll-behavior: auto !important;
        touch-action: auto;
    }
}
