/* Pagine di accesso: login, registrazione, collegamento account esterni (templates/gestione_schedine/auth/_layout.html). */
.auth-shell {
    --auth-green: #0f5b4f;
    --auth-green-deep: #0a4038;
    --auth-gold: #f3c77f;
    --auth-ink: #14231e;
    --auth-muted: #5b6e65;
    --auth-line: rgba(20, 35, 30, .12);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    max-width: 1040px;
    min-height: min(640px, calc(100vh - 170px));
    margin: 1.5rem auto 2.5rem;
    border: 1px solid var(--auth-line);
    border-radius: 24px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 24px 60px rgba(10, 40, 35, .10);
}

/* Pannello del marchio */
.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    padding: 2.2rem 2.2rem 2rem;
    color: #fff;
    background: var(--auth-green-deep);
    overflow: hidden;
}

.auth-brand::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -140px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    border: 56px solid rgba(243, 199, 127, .08);
    pointer-events: none;
}

.auth-brand-top {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -.01em;
}

.auth-brand-top img {
    width: 38px;
    height: 38px;
}

.auth-brand-claim {
    margin: 0;
    font-size: clamp(1.45rem, 2.4vw, 1.9rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.auth-brand-claim em {
    font-style: normal;
    color: var(--auth-gold);
}

.auth-brand-sub {
    margin: -.6rem 0 0;
    max-width: 32ch;
    color: #c9dbd5;
    font-size: .98rem;
    line-height: 1.5;
}

/* Telefono con uno screenshot dell'app (dati di esempio) */
.auth-phone {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    margin-top: auto;
    padding: .5rem 0 0;
}

.auth-phone-frame {
    width: 230px;
    aspect-ratio: 9 / 18.5;
    padding: 9px;
    border-radius: 38px;
    background: #10201c;
    box-shadow: 0 0 0 2px #2c4a42, 0 28px 60px rgba(0, 0, 0, .45);
    transform: rotate(-4deg);
}

.auth-phone-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    border-radius: 30px;
}

.auth-chip {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .75rem;
    border-radius: 999px;
    color: #14231e;
    background: #fbf8f1;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
    font-size: .8rem;
    font-weight: 800;
    white-space: nowrap;
}

.auth-chip i { color: #0f5b4f; }
.auth-chip-a { top: 18%; left: 0; }
.auth-chip-b { bottom: 14%; right: 0; }

/* Modulo */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.4rem 2rem;
}

.auth-card {
    width: 100%;
    max-width: 380px;
}

.auth-title {
    margin: 0 0 .35rem;
    color: var(--auth-ink);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

.auth-subtitle {
    margin: 0 0 1.4rem;
    color: var(--auth-muted);
}

.auth-field {
    margin-bottom: .95rem;
}

.auth-field label {
    display: block;
    margin-bottom: .3rem;
    color: var(--auth-ink);
    font-size: .88rem;
    font-weight: 700;
}

.auth-field .form-control {
    min-height: 48px;
    border-radius: 12px;
    border-color: #d6dcd8;
}

.auth-field .form-control:focus {
    border-color: var(--auth-green);
    box-shadow: 0 0 0 3px rgba(15, 91, 79, .15);
}

.auth-field-error {
    margin-top: .3rem;
    color: #b42318;
    font-size: .82rem;
}

.auth-field-help {
    margin-top: .3rem;
    color: var(--auth-muted);
    font-size: .8rem;
}

.auth-password {
    position: relative;
}

.auth-password .form-control {
    padding-right: 3rem;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: .35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 0;
    border-radius: 10px;
    color: var(--auth-muted);
    background: transparent;
    transform: translateY(-50%);
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
    color: var(--auth-green);
    background: #eef5f2;
}

.auth-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    margin: -.2rem 0 1rem;
    font-size: .85rem;
}

.auth-submit {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: var(--auth-green);
    font-weight: 800;
    font-size: 1rem;
}

.auth-submit:hover,
.auth-submit:focus-visible {
    color: #fff;
    background: var(--auth-green-deep);
}

.auth-links {
    margin-top: 1.3rem;
    color: var(--auth-muted);
    font-size: .88rem;
    text-align: center;
}

.auth-links a,
.auth-row a {
    color: var(--auth-green);
    font-weight: 700;
}

.auth-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin-top: 1.1rem;
    color: var(--auth-muted);
    font-size: .78rem;
}

.auth-trial {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.2rem;
    padding: .6rem .8rem;
    border-radius: 12px;
    color: #7a4f12;
    background: #fdf3e2;
    font-size: .85rem;
    font-weight: 700;
}

.auth-strength {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .25rem;
    margin-top: .45rem;
}

.auth-strength span {
    height: 4px;
    border-radius: 999px;
    background: #e3e8e5;
    transition: background-color .15s ease;
}

.auth-strength[data-livello="1"] span:nth-child(-n+1) { background: #d92d20; }
.auth-strength[data-livello="2"] span:nth-child(-n+2) { background: #d99b45; }
.auth-strength[data-livello="3"] span:nth-child(-n+3) { background: #5f9e6e; }
.auth-strength[data-livello="4"] span { background: var(--auth-green); }

/* Pulsanti "Continua con…" in cima al modulo */
.auth-card .accesso-social {
    margin: 0 0 1.1rem !important;
}

.auth-card .accesso-social-btn {
    min-height: 48px;
    border-radius: 12px;
    border-color: #d6dcd8;
    color: var(--auth-ink);
}

.auth-card .accesso-social-btn:hover {
    border-color: var(--auth-green);
    background: #f4f9f6;
    color: var(--auth-ink);
}

.auth-card .accesso-social-sep {
    order: 2;
    margin: 1.1rem 0 0 !important;
}

.auth-card .accesso-social {
    display: flex;
    flex-direction: column;
}

@media (max-width: 991.98px) {
    /* Su mobile niente grafica: solo il modulo (il logo è già nella barra in alto). */
    .auth-shell {
        display: block;
        min-height: 0;
        margin: .5rem auto 1.5rem;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .auth-brand {
        display: none;
    }

    .auth-panel {
        padding: .75rem .25rem 1.5rem;
    }
}
