/* Import Poppins font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ── Global ── */
* {
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}

/* ── Background ── */
.login-pf body {
    background-image: url("../img/background.jpg");
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    margin: 0;
}

/* ── Centra verticalmente la pagina ── */
.login-pf-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px 0;
}

/* ── Nascondiamo l'header esterno originale ── */
#kc-header {
    display: none !important;
}

/* ── Card login (La form bianca) ── */
.card-pf {
    max-width: 450px;
    width: 100%;
    padding: 40px; /* Uniformato il padding per fare spazio ai loghi */
    border-top: 5px solid #2196f3;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    background-color: #ffffff;
    position: relative;
    z-index: 1;
    
    /* Trasformiamo la card in flexbox per gestire i loghi interni */
    display: flex;
    flex-direction: column;
}

/* ── Logo Superiore (Level4) dentro la card ── */
.card-pf::before {
    content: "";
    display: block;
    background-image: url("../img/level4-logo.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    width: 100%;
    height: 120px; /* Ridotto leggermente per non allungare troppo la card */
    margin-bottom: 24px;
}

/* ── Logo Inferiore (SGR) dentro la card ── */
.card-pf::after {
    content: "";
    display: block;
    background-image: url("../img/sgr-logo.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    width: 100%;
    height: 50px; /* Sensibilmente più piccolo del logo Level4 */
    margin-top: 32px;
    opacity: 0.85; /* Leggermente trasparente per un look più raffinato */
}

/* ── Header dentro la card (Titolo) ── */
.login-pf-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
    position: static;
}

/* ── Titolo "Accedi al tuo account" ── */
#kc-page-title {
    text-align: center;
    font-size: 1.2rem !important;
    font-weight: 500 !important;
    color: #444444 !important;
    margin: 0 0 8px 0 !important;
    width: 100%;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: none !important;
    text-shadow: none !important;
}

/* ── Language selector: fixed viewport top-right ── */
#kc-locale {
    position: fixed !important;
    top: 16px !important;
    right: 16px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 9999 !important;
    transform: none !important;
}

/* ── Bottone lingua ── */
#kc-current-locale-link {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(0, 0, 0, 0.2) !important;
    border-radius: 8px !important;
    color: #333333 !important;
    padding: 6px 14px !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    font-size: 0.9rem !important;
}

#kc-current-locale-link:hover {
    background: #ffffff !important;
}

/* ── Dropdown lingua ── */
#language-switch1 {
    display: none !important;
}

#kc-current-locale-link[aria-expanded="true"] ~ * #language-switch1,
#kc-locale-dropdown:has(#kc-current-locale-link[aria-expanded="true"]) #language-switch1 {
    display: block !important;
}

#language-switch1 {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    margin-top: 4px;
    background: #ffffff;
    min-width: 160px;
}

.pf-c-dropdown__menu-item {
    padding: 8px 16px !important;
    color: #333333 !important;
    transition: background-color 0.15s ease;
}

/* ── Input fields ── */
.login-pf-page input[type="text"],
.login-pf-page input[type="password"],
.login-pf-page input[type="email"] {
    border-radius: 0;
    border: 1px solid #d0d0d0;
    padding: 10px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.login-pf-page input[type="text"]:focus,
.login-pf-page input[type="password"]:focus,
.login-pf-page input[type="email"]:focus {
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
    outline: none;
}

/* ── Tasto mostra/nascondi password ── */
.pf-c-button.pf-m-control {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    cursor: pointer;
}

/* ── Pulsante login ── */
#kc-login {
    border-radius: 10px !important;
    padding: 10px 20px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

#kc-login:hover {
    transform: translateY(-1px);
}

#kc-login:active {
    transform: translateY(0);
}

/* ── Alert / messaggi di errore ── */
.login-pf-page .alert {
    border-radius: 10px;
    padding: 12px 16px;
}
