#main {
    background-color: #E4F1F1;
    padding-top: 35px;
    top: 0;
}

form {
    border: 1px solid #6cabff;
}

form {
    border: 1px solid #80cdff;
}

form.wrong {
    border: 1px solid #ff8477;
}

h1 {
    font-weight: 400;
}

h2 {
    font-weight: 200;
    font-size: 1.5em;
    margin: 5px;
}

/* ===== Modern login (scoped) ===== */
#main {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
    background: radial-gradient(1200px 800px at 20% 10%, rgba(31, 74, 168, .10), transparent 55%),
    radial-gradient(900px 700px at 80% 20%, rgba(0, 185, 255, .12), transparent 60%),
    #eef6f6;
}

/* Card */
#main #login {
    width: min(460px, 100%);
    background: rgba(255, 255, 255, .86);
    border: 1px solid rgba(15, 23, 42, .10);
    box-shadow: 0 18px 50px rgba(15, 23, 42, .12);
    border-radius: 16px !important; /* override global border-radius: 0 !important */
    padding: 26px 26px 22px;
    backdrop-filter: blur(10px);
}
/* Desktop: alza leggermente la card (centro percettivo sui campi) */
#main #login{
    transform: translateY(-3vh);
}

/* Schermi molto bassi: alza meno */
@media (max-height: 800px){
    #main #login{ transform: translateY(-2vh); }
}

/* Mobile: gestisci come prima (top aligned) e togli il translate */
@media (max-width: 520px){
    #main #login{ transform: none; }
}
/* Logo + titles */
#main #login h1 {
    margin: 0 0 10px;
    font-weight: 700;
    letter-spacing: .2px;
    color: #0f172a;
}

#main #login h1 img {
    display: block;
    margin: 0 auto 10px;
    width: min(320px, 75%);
    height: auto;
}

#main #login h2 {
    margin: 6px 0 18px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(15, 23, 42, .65);
}

/* Fieldset reset */
#main #login fieldset {
    border: 0;
    padding: 0;
    margin: 0;
}

/* Labels */
#main #login label {
    display: block;
    margin: 14px 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(15, 23, 42, .78);
}

/* Inputs */
#main #login input[type="text"],
#main #login input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 12px;
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 12px !important;
    background: rgba(255, 255, 255, .95);
    font-size: 15px;
    outline: none;
    transition: box-shadow .15s ease, border-color .15s ease, transform .05s ease;
}

#main #login input[type="text"]:focus,
#main #login input[type="password"]:focus {
    border-color: rgba(31, 74, 168, .55);
    box-shadow: 0 0 0 4px rgba(31, 74, 168, .15);
}

#main #login input::placeholder {
    color: rgba(15, 23, 42, .35);
}

/* Button */
#main #login #loginBtn {
    width: 100%;
    margin-top: 18px;
    padding: 12px 14px;
    border: 0;
    border-radius: 12px !important;
    background: linear-gradient(180deg, #1f4aa8, #163c8f);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(31, 74, 168, .22);
    transition: transform .06s ease, box-shadow .15s ease, filter .15s ease;
}

#main #login #loginBtn:hover {
    filter: brightness(1.05);
    box-shadow: 0 14px 28px rgba(31, 74, 168, .26);
}

#main #login #loginBtn:active {
    transform: translateY(1px);
}

/* Wrong state (you already use form.wrong) */
#main #login.wrong {
    border-color: rgba(255, 132, 119, .9) !important;
    box-shadow: 0 18px 50px rgba(255, 132, 119, .12);
}

/* Optional: reduce motion */
@media (prefers-reduced-motion: reduce) {
    #main #login * {
        transition: none !important;
        animation: none !important;
    }
}
#main #login .pw-wrap{
    position: relative;
}

#main #login .pw-wrap input{
    padding-right: 44px;
}

#main #login .pw-toggle{
    position: absolute;
    top: 50%;
    right: 10px;

    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    padding: 0;              /* <-- fondamentale */
    margin: 0;
    border-radius: 10px !important;
    background: transparent;

    display: flex;           /* <-- centro reale */
    align-items: center;
    justify-content: center;

    line-height: 0;          /* <-- evita baseline shift */
    appearance: none;
    -webkit-appearance: none;

    cursor: pointer;
    color: rgba(15, 23, 42, .55);
}
@media (max-width: 520px){
    #main{
        place-items: start center;
        padding-top: calc(32px + env(safe-area-inset-top));
        padding-bottom: 24px;
    }
}
#main #login .pw-toggle:hover{
    background: rgba(15, 23, 42, .05);
    color: rgba(15, 23, 42, .75);
}

#main #login .pw-icon{
    display: block;          /* <-- evita “sotto-riga” */
    width: 18px;
    height: 18px;
    fill: currentColor;
}
#main #login .caps-warn{
    margin: 8px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: rgba(180, 60, 35, .92);
    display: flex;
    gap: 8px;
    align-items: center;
}
#main #login .pw-wrap{
    position: relative;
    height: 44px;   /* uguale al tuo input */
}
#main #login .pw-wrap input{
    height: 44px;
}
#main #login .caps-warn::before{
    content: "⚠";
    font-size: 13px;
}
#capsWarn[hidden] { display: none !important; }

#main #login .login-help{
    margin: -10px 0 14px;
    font-size: 13px;
    line-height: 1.35;
    color: rgba(15, 23, 42, .60);
    text-align: center;
}

.focus-in-expand {
    -webkit-animation: focus-in-expand 0.8s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
    animation: focus-in-expand 0.8s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}

/* ----------------------------------------------
 * Generated by Animista on 2020-12-30 8:59:24
 * Licensed under FreeBSD License.
 * See http://animista.net/license for more info.
 * w: http://animista.net, t: @cssanimista
 * ---------------------------------------------- */

/**
 * ----------------------------------------
 * animation focus-in-expand
 * ----------------------------------------
 */
@-webkit-keyframes focus-in-expand {
    0% {
        letter-spacing: -0.5em;
        -webkit-filter: blur(12px);
        filter: blur(12px);
        opacity: 0;
    }
    100% {
        -webkit-filter: blur(0px);
        filter: blur(0px);
        opacity: 1;
    }
}

@keyframes focus-in-expand {
    0% {
        letter-spacing: -0.5em;
        -webkit-filter: blur(12px);
        filter: blur(12px);
        opacity: 0;
    }
    100% {
        -webkit-filter: blur(0px);
        filter: blur(0px);
        opacity: 1;
    }
}

.tracking-in-expand-fwd {
    -webkit-animation: tracking-in-expand-fwd 0.8s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
    animation: tracking-in-expand-fwd 0.8s cubic-bezier(0.215, 0.610, 0.355, 1.000) both;
}

/* ----------------------------------------------
 * Generated by Animista on 2020-12-30 9:49:0
 * Licensed under FreeBSD License.
 * See http://animista.net/license for more info.
 * w: http://animista.net, t: @cssanimista
 * ---------------------------------------------- */

/**
 * ----------------------------------------
 * animation tracking-in-expand-fwd
 * ----------------------------------------
 */
@-webkit-keyframes tracking-in-expand-fwd {
    0% {
        letter-spacing: -0.5em;
        -webkit-transform: translateZ(-700px);
        transform: translateZ(-700px);
        opacity: 0;
    }
    40% {
        opacity: 0.6;
    }
    100% {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        opacity: 1;
    }
}

@keyframes tracking-in-expand-fwd {
    0% {
        letter-spacing: -0.5em;
        -webkit-transform: translateZ(-700px);
        transform: translateZ(-700px);
        opacity: 0;
    }
    40% {
        opacity: 0.6;
    }
    100% {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        opacity: 1;
    }
}
