@import url("./eashr-core.css");
@import url("./public-legacy.css");

/* EASHR_PUBLIC_CSS_RECOVERY_AND_ISOLATION_V1
   ============================================================
   EASHR PUBLIC — recovery + isolation
   ============================================================ */

body:not(.eashr-workspace-page){
    background:var(--eashr-bg);
    color:var(--eashr-text);
}

/*
 * Pico resta la base, ma sui form pubblici non deve imporre
 * proporzioni da UI generica sopra il design della landing.
 */
body:not(.eashr-workspace-page)
:where(input,select,textarea){
    border-color:var(--eashr-line);
}

body:not(.eashr-workspace-page)
:where(button,[role="button"]){
    font-weight:600;
}

/* ============================================================
   LANDING
   ============================================================ */

.landing-page{
    overflow-x:hidden;
}

.landing-page .landing-container{
    box-sizing:border-box;
}

/*
 * Mantiene la gerarchia visuale originale anche dopo Pico.
 */
.landing-page .landing-hero-copy h1{
    font-family:var(--pico-font-family)!important;
    font-weight:300!important;
}

.landing-page
:where(
    .landing-card,
    .feature-panel,
    .step-card,
    .anna-card,
    .auth-card
){
    border-radius:2px!important;
}

/*
 * Widget Carica file:
 * Pico può applicare margin/block-size molto grandi soprattutto
 * su Android. Normalizziamo soltanto il widget della landing.
 */
.landing-page .home-access-widget{
    min-width:0;
}

.landing-page .home-access-widget form{
    margin:0;
}

.landing-page .home-access-widget label{
    margin-bottom:.35rem;
}

.landing-page .home-access-widget
:where(
    input[type="email"],
    input[type="text"],
    input[type="password"],
    select,
    textarea
){
    width:100%;
    min-height:44px;
    margin:0;
    padding:.65rem .75rem;
    font-size:.92rem;
    line-height:1.25;
}

.landing-page .home-access-widget button{
    min-height:44px;
    margin:0;
    padding:.65rem .8rem;
    font-size:.86rem;
    line-height:1.2;
}

/*
 * Input file:
 * evita l'enorme bottone nativo visto su Android.
 */
.landing-page .home-access-widget input[type="file"]{
    width:100%;
    max-width:100%;
    min-height:0;
    margin:0;
    padding:.35rem;
    font-size:.78rem;
    line-height:1.2;
    border:0;
    background:transparent;
}

.landing-page .home-access-widget
input[type="file"]::file-selector-button{
    min-height:36px;
    margin:0 .55rem 0 0;
    padding:.45rem .65rem;
    border:1px solid var(--eashr-line);
    border-radius:2px;
    background:var(--eashr-surface-2);
    color:var(--eashr-text);
    font:inherit;
    font-weight:600;
    cursor:pointer;
}

.landing-page .home-access-widget
input[type="file"]::-webkit-file-upload-button{
    min-height:36px;
    margin:0 .55rem 0 0;
    padding:.45rem .65rem;
    border:1px solid var(--eashr-line);
    border-radius:2px;
    background:var(--eashr-surface-2);
    color:var(--eashr-text);
    font:inherit;
    font-weight:600;
}

/* ============================================================
   PUBLIC HEADER / LANGUAGE / FOOTER
   ============================================================ */

.eashr-public-header,
.eashr-global-footer{
    box-sizing:border-box;
}

.eashr-public-header a,
.eashr-global-footer a{
    text-decoration:none;
}

.eashr-public-language summary{
    border-radius:2px!important;
}

.eashr-public-language-menu{
    border-radius:2px!important;
}

.eashr-global-footer button{
    width:auto;
}

/* ============================================================
   PUBLIC DIALOGS
   ============================================================ */

body:not(.eashr-workspace-page) dialog[open]{
    width:min(680px,calc(100vw - 24px));
    max-width:680px;
    height:auto;
    max-height:88dvh;
    margin:auto;
    padding:0;
    background:transparent;
}

body:not(.eashr-workspace-page) dialog::backdrop{
    background:rgba(7,8,11,.72);
    backdrop-filter:blur(3px);
}

/* ============================================================
   TABLET / MOBILE RECOVERY
   ============================================================ */

@media(max-width:900px){
    /*
     * Nel layout storico il widget va prima del copy.
     * Manteniamo la stessa gerarchia, ma evitiamo min-height enormi.
     */
    .landing-page .landing-hero{
        min-height:0!important;
    }
}

@media(max-width:620px){
    /*
     * Mobile: il problema dello screenshot era soprattutto una scala
     * tipografica e di form eccessiva. Manteniamo il layout originale,
     * ma con dimensioni adatte allo schermo.
     */
    .landing-page{
        font-size:14px;
    }

    .landing-page .landing-container{
        width:min(100% - 28px,var(--landing-max,1280px))!important;
    }

    .landing-page .landing-hero{
        gap:1.4rem!important;
        min-height:0!important;
        padding:1.35rem 0 2.8rem!important;
        align-items:start!important;
    }

    .landing-page .landing-hero .landing-login{
        width:100%;
        max-width:none;
    }

    .landing-page .landing-hero .anna-card{
        width:100%;
        max-width:none;
        padding:1rem!important;
    }

    .landing-page .home-access-widget{
        font-size:14px;
    }

    .landing-page .home-access-widget
    :where(
        input[type="email"],
        input[type="text"],
        input[type="password"],
        select,
        textarea
    ){
        min-height:42px;
        padding:.58rem .65rem;
        font-size:16px; /* no zoom iOS/Android WebView */
    }

    .landing-page .home-access-widget button{
        min-height:42px;
        padding:.58rem .7rem;
        font-size:.82rem;
    }

    .landing-page .home-access-widget input[type="file"]{
        padding:.25rem 0;
        font-size:.72rem;
    }

    .landing-page .home-access-widget
    input[type="file"]::file-selector-button,
    .landing-page .home-access-widget
    input[type="file"]::-webkit-file-upload-button{
        min-height:34px;
        padding:.4rem .55rem;
        font-size:.76rem;
    }

    .landing-page .landing-hero-copy h1{
        margin:.2rem 0 .8rem!important;
        font-size:clamp(2.35rem,11vw,3.35rem)!important;
        line-height:.98!important;
        letter-spacing:-.045em!important;
    }

    .landing-page .landing-hero-copy .lead{
        font-size:.93rem!important;
        line-height:1.55!important;
    }

    .landing-page .hero-note{
        font-size:.82rem!important;
        line-height:1.5!important;
    }

    .landing-page section{
        scroll-margin-top:70px;
    }

    /*
     * Evita titoli tipo "Quattro modi..." giganteschi e tagliati.
     */
    .landing-page
    :where(
        #features,
        #how
    )
    h2{
        font-size:clamp(2rem,9.5vw,3rem)!important;
        line-height:1.02!important;
        letter-spacing:-.04em!important;
    }
}

@media(max-width:420px){
    .landing-page .landing-container{
        width:calc(100% - 24px)!important;
    }

    .landing-page .landing-hero{
        padding-top:1rem!important;
    }

    .landing-page .landing-hero-copy h1{
        font-size:clamp(2.15rem,10.8vw,2.8rem)!important;
    }
}

/* Light */
html[data-theme="light"]
body:not(.eashr-workspace-page){
    background:var(--eashr-bg);
}

/* RTL */
html[dir="rtl"] .landing-page{
    direction:rtl;
}

/* /EASHR_PUBLIC_CSS_RECOVERY_AND_ISOLATION_V1 */

/* EASHR_PUBLIC_ROOT_AND_SPLASH_REBUILD_V1 — INDIGO PUBLIC BRAND */
body:not(.eashr-workspace-page){
    --eashr-accent:#655cd6;
    --eashr-accent-strong:#524ed2;
    --eashr-accent-soft:#a294e5;

    --purple:var(--eashr-accent);
    --purple2:var(--eashr-accent-soft);

    --pico-primary:#a294e5;
    --pico-primary-background:#524ed2;
    --pico-primary-border:#524ed2;
    --pico-primary-hover:#bdb2ec;
    --pico-primary-hover-background:#655cd6;
    --pico-primary-hover-border:#655cd6;
    --pico-primary-focus:rgba(162,148,229,.375);
    --pico-primary-inverse:#fff;
}
/* /EASHR_PUBLIC_ROOT_AND_SPLASH_REBUILD_V1 — INDIGO PUBLIC BRAND */

/* EASHR_PUBLIC_HEADER_ALIGNMENT_V1_1
   ============================================================
   PUBLIC HEADER — ALIGNMENT CANONICO
   ============================================================ */

body:not(.eashr-workspace-page)
.eashr-public-header{
    --eashr-public-header-control-height:40px;

    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;

    gap:1.25rem!important;
}

body:not(.eashr-workspace-page)
.eashr-public-brand{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:flex-start!important;

    margin:0!important;
    padding:0!important;

    line-height:1!important;
}

body:not(.eashr-workspace-page)
.eashr-public-nav{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;

    gap:.72rem!important;

    min-width:0!important;

    margin:0!important;
    padding:0!important;

    line-height:1!important;
}

body:not(.eashr-workspace-page)
.eashr-public-nav-links{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;

    gap:1rem!important;

    height:var(--eashr-public-header-control-height)!important;

    margin:0!important;
    padding:0!important;
}

body:not(.eashr-workspace-page)
.eashr-public-nav-links > a{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;

    height:var(--eashr-public-header-control-height)!important;
    min-height:var(--eashr-public-header-control-height)!important;

    margin:0!important;
    padding:0 .15rem!important;

    line-height:1!important;
    white-space:nowrap!important;
}

/* ============================================================
   LANGUAGE SWITCHER
   ============================================================ */

body:not(.eashr-workspace-page)
.eashr-public-language{
    position:relative!important;

    display:block!important;

    width:206px!important;
    flex:0 0 206px!important;

    height:var(--eashr-public-header-control-height)!important;

    margin:0!important;
    padding:0!important;
}

body:not(.eashr-workspace-page)
.eashr-public-language > summary{
    box-sizing:border-box!important;

    display:grid!important;
    grid-template-columns:24px minmax(0,1fr) 18px!important;
    align-items:center!important;

    column-gap:.55rem!important;

    width:100%!important;

    height:var(--eashr-public-header-control-height)!important;
    min-height:var(--eashr-public-header-control-height)!important;

    margin:0!important;
    padding:0 .72rem!important;

    border:1px solid rgba(255,255,255,.10)!important;
    border-radius:2px!important;

    background:transparent!important;

    line-height:1!important;

    list-style:none!important;
    cursor:pointer!important;

    box-shadow:none!important;
}

/*
 * Browser + Pico:
 * nessun marker/pseudo-indicatore automatico.
 */
body:not(.eashr-workspace-page)
.eashr-public-language > summary::marker{
    content:""!important;
    display:none!important;
}

body:not(.eashr-workspace-page)
.eashr-public-language
> summary::-webkit-details-marker{
    display:none!important;
}

body:not(.eashr-workspace-page)
.eashr-public-language > summary::before,
body:not(.eashr-workspace-page)
.eashr-public-language > summary::after{
    content:none!important;
    display:none!important;
}

/*
 * Manteniamo solo la freccia Remix già presente nel markup.
 */
body:not(.eashr-workspace-page)
.eashr-public-language
> summary
> i.ri-arrow-down-s-line{
    display:grid!important;
    place-items:center!important;

    width:18px!important;
    height:18px!important;

    margin:0!important;
    padding:0!important;

    font-size:1rem!important;
    line-height:1!important;

    transform:none!important;
    transition:transform .16s ease!important;
}

body:not(.eashr-workspace-page)
.eashr-public-language[open]
> summary
> i.ri-arrow-down-s-line{
    transform:rotate(180deg)!important;
}

body:not(.eashr-workspace-page)
.eashr-public-language
.eashr-language-flag{
    display:grid!important;
    place-items:center!important;

    width:24px!important;
    min-width:24px!important;

    margin:0!important;
}

body:not(.eashr-workspace-page)
.eashr-public-language
.eashr-language-name{
    display:block!important;

    min-width:0!important;

    margin:0!important;
    padding:0!important;

    line-height:1.1!important;

    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
}

/* ============================================================
   LOGIN
   ============================================================ */

body:not(.eashr-workspace-page)
.eashr-public-login{
    box-sizing:border-box!important;

    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;

    height:var(--eashr-public-header-control-height)!important;
    min-height:var(--eashr-public-header-control-height)!important;

    margin:0!important;
    padding:0 .95rem!important;

    line-height:1!important;
    white-space:nowrap!important;
}

/* ============================================================
   TABLET
   ============================================================ */

@media(max-width:900px){
    body:not(.eashr-workspace-page)
    .eashr-public-nav{
        gap:.5rem!important;
    }

    body:not(.eashr-workspace-page)
    .eashr-public-nav-links{
        gap:.7rem!important;
    }

    body:not(.eashr-workspace-page)
    .eashr-public-language{
        width:184px!important;
        flex-basis:184px!important;
    }
}

/* /EASHR_PUBLIC_HEADER_ALIGNMENT_V1_1 */
