header {
    background: linear-gradient(60deg,#003256,#316695, #ffffff, #ffffff);
}

.my-header {
    background: #0085ce!important;
    padding: 10px 50px!important;
}

.my-header .logo {
    border: 0!important;
    max-height: none!important;
}

#page-header .logo {
    max-height: 3rem!important;
}

#page-footer {
    /*background: #0085ce!important;*/
    padding: 0!important;
    margin-top: 0!important;
}

.spid-idp-button .spid-idp-button-menu li > a {
    text-align: left!important;
}
.spid-idp-button .spid-idp-button-menu li > a img {
    height: 45px!important;
}

footer {
    display: none;
}

/* ── Login page ── */

:root {
    --spid-blue:    #0066CC;
    --cie-green:    #009900;
    --it-red:       #CE2B37;
    --it-white:     #FFFFFF;
    --it-green:     #009246;
    --bg:           #F0F3F7;
    --surface:      #FFFFFF;
    --text-primary: #1A1A2E;
    --text-muted:   #5A6478;
    --border:       #DDE2EA;
    --shadow-lg:    0 12px 40px rgba(0,0,0,.12);
    --radius:       12px;
    --font:         'Titillium Web', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background-color: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(0,102,204,.04) 0%, transparent 50%),
        linear-gradient(225deg, rgba(0,146,70,.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.tricolore-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 4px;
    display: flex;
    z-index: 100;
}
.tricolore-bar span { flex: 1; }
.tricolore-bar span:nth-child(1) { background: var(--it-green); }
.tricolore-bar span:nth-child(2) { background: var(--it-white); border-top: 1px solid var(--border); }
.tricolore-bar span:nth-child(3) { background: var(--it-red); }

.page-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: slideUp .5s cubic-bezier(.16,1,.3,1) both;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.panel-brand {
    border-radius: var(--radius) 0 0 var(--radius);
    background: linear-gradient(155deg, #0055AA 0%, #0077EE 100%);
    padding: 52px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.panel-brand::after {
    content: '';
    position: absolute;
    bottom: -60px; right: -60px;
    width: 220px; height: 220px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
}

.brand-logo {
    display: block;
    max-width: 160px;
    height: auto;
    margin-bottom: 24px;
    filter: brightness(0) invert(1);
}

.brand-top .label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .7;
    margin-bottom: 10px;
}
.brand-top h1 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
}
.brand-top p {
    font-size: 14px;
    font-weight: 300;
    line-height: 1.7;
    opacity: .85;
}
.brand-bottom {
    font-size: 12px;
    opacity: .55;
    font-weight: 300;
}

.panel-form {
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--surface);
    padding: 52px 44px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.panel-form h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.auth-section {
    margin-bottom: 28px;
    animation: fadeIn .4s ease both;
}
.auth-section:nth-child(2) { animation-delay: .08s; }
.auth-section:nth-child(3) { animation-delay: .16s; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(8px); }
    to   { opacity: 1; transform: translateX(0); }
}

.auth-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.auth-section-inner {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    transition: border-color .2s;
}
.auth-section-inner:hover { border-color: #b0bccc; }

/* Wrapper del bottone SPID: position:relative è il riferimento per il dropdown assoluto */
.spid-btn-wrap {
    position: relative;
    display: inline-block;
}

.auth-section-inner p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.info-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--spid-blue);
    text-decoration: none;
    transition: opacity .2s;
}
.info-link:hover { opacity: .75; text-decoration: underline; }
.info-link-cie { color: var(--cie-green); }
.info-link::before { content: '→'; font-size: 11px; }

.logo-agid-wrap {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.logo-agid {
    height: 32px;
    width: auto;
    opacity: .85;
}

.profile-card {
    background: #F7FAFF;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 20px;
}
.profile-card .idp-badge {
    display: inline-block;
    background: var(--spid-blue);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 14px;
}
.profile-card .attr-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    gap: 12px;
}
.profile-card .attr-row:last-child { border-bottom: none; }
.profile-card .attr-key {
    color: var(--text-muted);
    font-weight: 400;
    white-space: nowrap;
    flex-shrink: 0;
}
.profile-card .attr-val {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
    word-break: break-all;
}
.profile-card .response-id {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    font-family: monospace;
    letter-spacing: .02em;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: transparent;
    border: 1.5px solid var(--it-red);
    color: var(--it-red);
    border-radius: 6px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, color .2s;
}
.btn-logout:hover { background: var(--it-red); color: #fff; }

.page-footer {
    display: block; /* override della regola generica footer { display: none } */
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    z-index: 1;
    position: relative;
    animation: fadeIn .5s .3s ease both;
}
.page-footer a { color: var(--spid-blue); text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }

@media (max-width: 680px) {
    .page-wrapper {
        grid-template-columns: 1fr;
        max-width: 440px;
    }
    .panel-brand {
        border-radius: var(--radius) var(--radius) 0 0;
        padding: 32px 28px;
    }
    .panel-form {
        border-radius: 0 0 var(--radius) var(--radius);
        padding: 32px 24px;
    }
    .panel-brand::after { display: none; }
    .brand-top h1 { font-size: 22px; }
    .brand-bottom { display: none; }
}

@media (max-width: 420px) {
    .panel-form { padding: 28px 18px; }
    .panel-brand { padding: 28px 20px; }
}

.button-spid {
    border-radius: 0!important;
}

.align-center {
    text-align: center;
}