/* file => auth-login-templates.css | versione => 1.2.0 | data => 12-03-2026 14:00
 * @changelog
 *   1.2.0 (12-03-2026) - Colori hardcoded sostituiti con variabili --tblr-border-color e --tblr-*
 *   1.1.0 (21-02-2026) - Gradiente usa CSS vars --auth-gradient-start/end configurabili
 *   1.0.0 (19-02-2026) - 4 template login: centered, split, fullbg, gradient */

/* ============================================
   TEMPLATE: CENTERED (default)
   Card bianca centrata su sfondo colorato
   ============================================ */
body.auth-template-centered .auth-brand-panel {
    display: none;
}

/* ============================================
   TEMPLATE: SPLIT
   Schermo diviso: sinistra brand, destra form
   ============================================ */
body.auth-template-split .auth-container {
    flex-direction: row;
    padding: 0;
}

body.auth-template-split .auth-brand-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 50%;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--auth-primary, #487FFF) 0%, color-mix(in srgb, var(--auth-primary, #487FFF) 70%, #000) 100%);
    background-image: var(--auth-bg-image, none);
    background-size: cover;
    background-position: center;
    color: #fff;
    padding: 3rem;
    position: relative;
}

body.auth-template-split .auth-brand-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.5) 100%);
    pointer-events: none;
}

body.auth-template-split .auth-brand-panel .brand-panel-logo,
body.auth-template-split .auth-brand-panel .brand-panel-title {
    position: relative;
    z-index: 1;
}

body.auth-template-split .auth-brand-panel .brand-panel-logo {
    max-height: 80px;
    max-width: 250px;
    margin-bottom: 2rem;
    filter: brightness(0) invert(1);
}

body.auth-template-split .auth-brand-panel .brand-panel-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.auth-template-split .auth-form-panel {
    width: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 100vh;
}

body.auth-template-split .auth-card {
    box-shadow: none;
    max-width: 380px;
}

body.auth-template-split .auth-footer {
    position: absolute;
    bottom: 1rem;
    width: 50%;
    right: 0;
}

/* Split - Mobile */
@media (max-width: 768px) {
    body.auth-template-split .auth-container {
        flex-direction: column;
    }
    body.auth-template-split .auth-brand-panel {
        width: 100%;
        min-height: 200px;
        padding: 2rem;
    }
    body.auth-template-split .auth-brand-panel .brand-panel-title {
        font-size: 1.3rem;
    }
    body.auth-template-split .auth-form-panel {
        width: 100%;
        min-height: auto;
        padding: 1.5rem;
    }
    body.auth-template-split .auth-footer {
        position: static;
        width: 100%;
    }
}

/* ============================================
   TEMPLATE: FULLBG
   Sfondo full-screen + card trasparente
   ============================================ */
body.auth-template-fullbg {
    background-image: var(--auth-bg-image, none);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

body.auth-template-fullbg .auth-brand-panel {
    display: none;
}

body.auth-template-fullbg .auth-container::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 0;
}

body.auth-template-fullbg .auth-card {
    position: relative;
    z-index: 1;
    background: #fff;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

body.auth-template-fullbg .auth-footer {
    position: relative;
    z-index: 1;
}

body.auth-template-fullbg .auth-footer small {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* ============================================
   TEMPLATE: GRADIENT
   Gradiente animato + card floating
   ============================================ */
body.auth-template-gradient {
    background: linear-gradient(-45deg,
        var(--auth-gradient-start, #487FFF),
        var(--auth-gradient-end, #e73c7e),
        color-mix(in srgb, var(--auth-gradient-start, #487FFF) 50%, var(--auth-gradient-end, #e73c7e)),
        var(--auth-gradient-start, #487FFF));
    background-size: 400% 400%;
    animation: auth-gradient-shift 15s ease infinite;
}

body.auth-template-gradient .auth-brand-panel {
    display: none;
}

@keyframes auth-gradient-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body.auth-template-gradient .auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: auth-card-float 6s ease-in-out infinite;
}

@keyframes auth-card-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

body.auth-template-gradient .auth-footer small {
    color: rgba(255, 255, 255, 0.85) !important;
}

/* ============================================
   RESPONSIVE GLOBALE (tutti i template)
   ============================================ */
@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    .auth-title {
        font-size: 1.25rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    body.auth-template-split .auth-brand-panel {
        width: 40%;
    }
    body.auth-template-split .auth-form-panel {
        width: 60%;
    }
}
