/* ══════════════════════════════════════════════════════
   GRAVITY — Pagine di autenticazione (login, forgot, reset)
   ══════════════════════════════════════════════════════ */

/* ── TEMA CHIARO ────────────────────────────────────────
   Per attivare: togli il commento da questo blocco
   e commenta il blocco TEMA SCURO qui sotto.
   ────────────────────────────────────────────────────────
:root {
    --gv-auth-bg-1:          #054d78;
    --gv-auth-bg-2:          #0d78b0;
    --gv-auth-bg-3:          #0f92d0;
    --gv-auth-card-overlay:  rgba(4, 59, 95, 0.15);
    --gv-auth-card-image:    url('/assets/images/sfondi/SfondoLoginV4.png');
    --gv-auth-link-color:    #1a1f36;
    --gv-auth-link-hover:    #000;
}
*/

/* ── TEMA SCURO (attivo di default) ─────────────────────
   Per disattivare: commenta questo blocco.
   ───────────────────────────────────────────────────────── */
:root {
    --gv-auth-bg-1:          #02152f;
    --gv-auth-bg-2:          #03224a;
    --gv-auth-bg-3:          #05366d;
    --gv-auth-card-overlay:  rgba(0, 0, 0, 0.45);
    --gv-auth-card-image:    url('/assets/images/sfondi/SfondoLogin.png');
    --gv-auth-link-color:    #28a4e6;
    --gv-auth-link-hover:    #5ec0f5;
}

/* ── TEMA VERDE — attivato via data-color-theme="green" su <html> ── */
[data-color-theme="green"] {
    --gv-auth-bg-1:          #041f1c;
    --gv-auth-bg-2:          #073d36;
    --gv-auth-bg-3:          #0d5a50;
    --gv-auth-card-overlay:  rgba(0, 0, 0, 0.40);
    --gv-auth-card-image:    url('/assets/images/sfondi/SfondoLogin.png');
    --gv-auth-link-color:    #13A99B;
    --gv-auth-link-hover:    #6DD4C8;
}

[data-color-theme="green"] .btn-gv-login {
    background: #0C7A6E;
    box-shadow: 0 6px 20px rgba(12, 122, 110, .40);
}

[data-color-theme="green"] .btn-gv-login:hover {
    background: #13A99B;
    box-shadow: 0 8px 24px rgba(19, 169, 155, .50);
}

[data-color-theme="green"] .gv-input-wrap input:focus {
    background: #e8f5f4;
    box-shadow: 0 0 0 2.5px rgba(19, 169, 155, .30);
}
/* ─────────────────────────────────────────────────────── */

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        135deg,
        var(--gv-auth-bg-1) 0%,
        var(--gv-auth-bg-2) 35%,
        var(--gv-auth-bg-3) 70%,
        var(--gv-auth-bg-1) 100%
    );
}

/* ── Sfondo astratto SVG (forgot / reset) ── */
.gv-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.gv-bg svg {
    width: 100%;
    height: 100%;
}

/* ── Canvas animato (login) ── */
.gv-login-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    display: block;
}

/* ── Card (usata nel login: ha immagine di sfondo) ── */
.gv-card {
    display: flex;
    position: relative;
    width: 1100px;
    max-width: 95vw;
    min-height: 620px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .40);
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.gv-card-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--gv-auth-card-image) center center / cover no-repeat;
}

.gv-card-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gv-auth-card-overlay);
}

/* ── Pannello sinistro decorativo (solo login) ── */
.gv-deco {
    flex: 1;
    position: relative;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem;
    z-index: 1;
}

.gv-deco-text {
    position: relative;
    z-index: 2;
}

.gv-deco-logo {
    width: 400px;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 2px 12px rgba(0,0,0,.20));
}

.gv-deco-text h2 {
    color: #fff;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: .5rem;
    line-height: 1.2;
}

.gv-deco-text p {
    color: rgba(255, 255, 255, .70);
    font-size: .82rem;
    line-height: 1.6;
    max-width: 240px;
    margin: 0;
}

/* ── Pannello form con effetto vetro ── */
.gv-form-panel {
    flex: 0 0 420px;
    align-self: center;
    position: relative;
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    margin: 32px;
    border-radius: 14px;
    z-index: 1;
}

/* Versione standalone: usata in forgot e reset (senza gv-card wrapper) */
.gv-form-panel--standalone {
    flex: none;
    width: 420px;
    max-width: 95vw;
    margin: 0;
    align-self: auto;
}

/* ── Contenuto form ── */
.gv-form-inner {
    width: 100%;
    max-width: 330px;
    position: relative;
    z-index: 2;
}

.gv-form-inner h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: .3rem;
}

.gv-form-inner .gv-subtitle {
    color: #cfd2d6;
    font-size: .82rem;
    margin-bottom: 1.75rem;
}

/* ── Input con icona ── */
.gv-input-wrap {
    position: relative;
    margin-bottom: 1rem;
}

.gv-input-wrap .gv-icon {
    position: absolute;
    left: .9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.05rem;
    pointer-events: none;
}

.gv-input-wrap input {
    width: 100%;
    background: #f0f2f5;
    border: none;
    border-radius: .7rem;
    padding: .75rem 2.8rem;
    font-size: .88rem;
    color: #1a1f36;
    outline: none;
    transition: background .2s, box-shadow .2s;
}

.gv-input-wrap input:focus {
    background: #e8f4fc;
    box-shadow: 0 0 0 2.5px rgba(15, 136, 199, .30);
}

.gv-input-wrap input::placeholder { color: #b0b8cc; }

/* Fix autofill Safari/Chrome: impedisce che il background scompaia */
.gv-input-wrap input:-webkit-autofill,
.gv-input-wrap input:-webkit-autofill:hover,
.gv-input-wrap input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #f0f2f5 inset !important;
    box-shadow: 0 0 0 1000px #f0f2f5 inset !important;
    -webkit-text-fill-color: #1a1f36 !important;
}

/* ── Toggle password ── */
.gv-pw-toggle {
    position: absolute;
    right: .9rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 0;
}

/* Sposta icona nativa Safari a sinistra per non sovrapporsi al toggle */
.auth-pass-inputgroup input::-webkit-credentials-auto-fill-button,
.auth-pass-inputgroup input::-webkit-strong-password-auto-fill-button {
    margin-right: 2.2rem;
}

/* ── Riga remember + forgot ── */
.gv-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: .8rem;
}

.gv-row label { color: #cfd2d6; font-weight: 500; }
.gv-row a { color: var(--gv-auth-link-color); font-weight: 600; text-decoration: none; }
.gv-row a:hover { color: var(--gv-auth-link-hover); text-decoration: underline; }

/* Link centrato (usato in forgot e reset) */
.gv-center-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: .82rem;
    color: #cfd2d6;
}

.gv-center-link a { color: var(--gv-auth-link-color); font-weight: 600; text-decoration: none; }
.gv-center-link a:hover { color: var(--gv-auth-link-hover); text-decoration: underline; }

/* ── Alert messaggi ── */
.gv-form-inner .alert {
    border-radius: .65rem;
    padding: .7rem 1rem;
    font-size: .82rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    border-width: 1px;
    border-style: solid;
}

.gv-form-inner .alert-danger {
    background: rgba(220, 53, 69, 0.40);
    border-color: rgba(220, 53, 69, 0.80);
    color: #ffe0e4;
}

.gv-form-inner .alert-danger li { margin-bottom: .2rem; }
.gv-form-inner .alert-danger li:last-child { margin-bottom: 0; }

.gv-form-inner ul.alert {
    list-style: none;
    padding-left: 1rem;
    margin: 0 0 1.25rem 0;
}

.gv-form-inner .alert-success {
    background: rgba(25, 135, 84, 0.15);
    border-color: rgba(25, 135, 84, 0.45);
    color: #a3d9b8;
}

/* ── Bottone primario ── */
.btn-gv-login {
    width: 100%;
    padding: .78rem;
    border: none;
    border-radius: .7rem;
    font-size: .95rem;
    font-weight: 600;
    color: #fff;
    background: #0d2f6e;
    letter-spacing: .02em;
    cursor: pointer;
    transition: background .2s, box-shadow .2s;
    box-shadow: 0 6px 20px rgba(13, 47, 110, .35);
}

.btn-gv-login:hover {
    background: #0a2558;
    box-shadow: 0 8px 24px rgba(13, 47, 110, .45);
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .gv-deco { display: none; }
    .gv-card { border-radius: 16px; }
    .gv-form-panel--standalone { padding: 2rem 1.5rem; }
}

/* Il gv-loader viene iniettato da vendor-scripts ma custom.css
   (dove è definito come hidden) non è caricato nelle pagine auth. */
#gv-loader { display: none !important; }

