/* ============================================================
   comune-base.css
   Stili per il tema login Keycloak - Comune di Messina
   ============================================================ */


/* ------------------------------------------------------------
   Variabili
   ------------------------------------------------------------ */
:root {
    --colore-primario: #112552;
    --colore-secondario: #193676;
    --colore-footer: #343a40;
    --colore-testo: #1a1a1a;
    --colore-testo-chiaro: #ffffff;
    --colore-errore: #c02b2b;
    --colore-bordo: #d9d9d9;
    --font-principale: 'Titillium Web', sans-serif;
}


/* ------------------------------------------------------------
   Layout generale
   ------------------------------------------------------------ */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: var(--font-principale);
    background-color: #f5f5f5;
    color: var(--colore-testo);
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.kc-main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.container-max-width {
    max-width: 1200px;
}


/* ------------------------------------------------------------
   Header - barra slim
   ------------------------------------------------------------ */
.it-header-slim-wrapper {
    background-color: var(--colore-primario);
    height: 48px;
    padding: 0;
}

.it-header-slim-wrapper .navbar-brand {
    color: var(--colore-testo-chiaro);
    font-size: 0.85rem;
    text-decoration: none;
}

.it-header-slim-wrapper .navbar-brand:hover {
    text-decoration: underline;
}


/* ------------------------------------------------------------
   Header - barra principale
   ------------------------------------------------------------ */
.it-header-center-wrapper {
    background-color: var(--colore-secondario);
    height: 120px;
    padding-top: 6px;
}

.it-brand-wrapper {
    margin-left: -15px !important;
}

.it-brand-wrapper a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--colore-testo-chiaro);
}

.municipality__logo img {
    height: 100px;
    width: auto;
}

.it-brand-text .h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--colore-testo-chiaro);
    margin: 8px !important;
}

.it-header-center-content-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}


/* ------------------------------------------------------------
   Header - social
   ------------------------------------------------------------ */
.it-socials {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--colore-testo-chiaro);
    font-size: 0.85rem;
}

.it-socials ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.5rem;
}

.it-socials .icon {
    fill: var(--colore-testo-chiaro);
    width: 24px;
    height: 24px;
}

.it-socials a:hover .icon {
    fill: #cce0f5;
}


/* ------------------------------------------------------------
   Card login
   ------------------------------------------------------------ */
.kc-login-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.10);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 440px;
}

.kc-login-card .kc-login-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--colore-primario);
    margin-bottom: 1.5rem;
    text-align: center;
}


/* ------------------------------------------------------------
   Form
   ------------------------------------------------------------ */
.form-control:focus,
.form-control:focus-visible,
.input-password:focus,
.password-icon:focus,
.btn:focus,
.btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}


/* ------------------------------------------------------------
   Link
   ------------------------------------------------------------ */
a:focus:not(.focus--mouse),
a:focus-visible:not(.focus--mouse) {
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}


/* ------------------------------------------------------------
   Form LDAP
   ------------------------------------------------------------ */
.kc-form-group {
    margin-bottom: 1.2rem;
}

.kc-form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--colore-testo);
}

.kc-form-group input[type="text"],
.kc-form-group input[type="password"] {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--colore-bordo);
    border-radius: 4px;
    font-size: 1rem;
    font-family: var(--font-principale);
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.kc-form-group input:focus {
    outline: none;
    border-color: var(--colore-secondario);
    box-shadow: 0 0 0 3px rgba(0, 82, 155, 0.15);
}

.kc-login-btn {
    width: 100%;
    padding: 0.65rem;
    background-color: var(--colore-secondario);
    color: var(--colore-testo-chiaro);
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-principale);
    transition: background-color 0.2s;
}

.kc-login-btn:hover {
    background-color: var(--colore-primario);
}


/* ------------------------------------------------------------
   Separatore tra form e pulsanti IDP
   ------------------------------------------------------------ */
.kc-separator {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    gap: 0.75rem;
    color: #888;
    font-size: 0.85rem;
}

.kc-separator::before,
.kc-separator::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--colore-bordo);
}


/* ------------------------------------------------------------
   Pulsanti SPID / CIE
   ------------------------------------------------------------ */
.kc-idp-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.kc-idp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.65rem;
    border: 2px solid var(--colore-bordo);
    border-radius: 4px;
    background-color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    color: var(--colore-testo);
    font-family: var(--font-principale);
    transition: border-color 0.2s, background-color 0.2s;
}

.kc-idp-btn:hover {
    border-color: var(--colore-secondario);
    background-color: #f0f7ff;
    color: var(--colore-primario);
}

.kc-idp-btn img {
    height: 28px;
    width: auto;
}


/* ------------------------------------------------------------
   Messaggi di errore / alert
   ------------------------------------------------------------ */
.kc-feedback {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.kc-feedback.error {
    background-color: #fdecea;
    border-left: 4px solid var(--colore-errore);
    color: var(--colore-errore);
}

.kc-feedback.info {
    background-color: #e8f0fb;
    border-left: 4px solid var(--colore-secondario);
    color: var(--colore-primario);
}


/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.footer-institutional {
    background-color: var(--colore-footer);
    color: var(--colore-testo-chiaro);
    padding: 1.2rem 0 0 0;
    margin-top: auto;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.footer-brand img {
    height: 70px;
    width: auto;
    filter: brightness(0) invert(1);
}

.footer-brand-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--colore-testo-chiaro);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
    color: #ced4da;
}

.footer-links a {
    color: #ced4da;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--colore-testo-chiaro);
    text-decoration: underline;
}

.footer-bottom {
    margin-top: 0;
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.82rem;
    color: #adb5bd;
    background-color: #303030;
}

.footer-bottom a {
    color: #adb5bd;
    text-decoration: none;
}

.footer-bottom a:hover {
    color: var(--colore-testo-chiaro);
    text-decoration: underline;
}


/* ------------------------------------------------------------
   SPID - override dimensione e allineamento icone IdP
   ------------------------------------------------------------ */
.spid-idp-button .spid-idp-button-menu li > a img {
    height: 40px !important;
    padding: 8px 0 8px 10px !important;
    display: block;
}

.spid-idp-button .spid-idp-button-menu li > a {
    text-align: left;
    padding-left: 10px;
}


/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 991px) {
    .it-header-center-wrapper {
        height: auto;
        padding: 0.75rem 0;
    }

    .municipality__logo img {
        height: 60px;
    }

    .it-brand-text .h2 {
        font-size: 1.1rem;
    }

    .it-socials {
        display: none;
    }
}

@media (max-width: 768px) {
    .it-header-slim-wrapper {
        padding-top: 0.5rem;
    }

    .municipality__logo img {
        height: 48px;
    }

    .it-brand-text .h2 {
        font-size: 1rem;
    }

    .kc-login-card {
        padding: 1.5rem 1rem;
        border-radius: 4px;
        max-width: 100%;
    }

    .kc-main-content {
        padding: 0.5rem 1.5rem;
        align-items: center;
    }

    .footer-institutional {
        display: none;
    }

    .footer-bottom {
        margin-top: 0;
        border-top: none;
    }

    .footer-separator {
        display: none;
    }

    .footer-brand img {
        height: 50px;
    }

    .footer-brand-text {
        font-size: 0.95rem;
    }

    .footer-bottom {
        text-align: center;
        padding: 0.75rem 0;
        margin-top: 1rem;
    }
}

/* ------------------------------------------------------------
   Schermi con poca altezza (es. notebook) - nascondi footer info
   ------------------------------------------------------------ */
@media (max-height: 900px) {
    .footer-institutional {
        display: none;
    }
    .footer-bottom {
        border-top: none;
    }
}
