:root {
    --primary: #00a2ea;
    --primary-dark: #125eac;
    --accent: #f87002;
    --bg: #f5f6f6;
    --text: #4a4a4a;
    --muted: #6f6f6f;
    --border: #d9d9d9;
    --card: #ffffff;
}

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

body {
    margin: 0;
    font-family: "Titillium Web", Arial, sans-serif;
    color: var(--text);
    background: #fff;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
}

a:hover {
    color: var(--primary);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 1000;
}

.skip-link:focus {
    left: 12px;
    top: 12px;
    width: auto;
    height: auto;
    padding: 10px 14px;
    background: var(--primary);
    color: #fff;
}

.container {
    width: 100%;
    max-width: 1180px;
    padding: 0 18px;
    margin: 0 auto;
}

.topbar {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 0;
}

.service-menu ul {
    list-style: none;
    display: flex;
    gap: 14px;
    margin: 0;
    padding: 0;
}

.service-menu a {
    color: var(--muted);
    font-weight: 600;
}

.login {
    display: flex;
    gap: 8px;
    align-items: center;
}

.login__btn img {
    display: block;
    height: 36px;
}

.logo-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    gap: 16px;
}

.logo-row__brand img {
    max-height: 70px;
    width: auto;
}

.main-nav {
    background: #fff;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    padding: 10px 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-dark);
    border-radius: 6px;
}

.nav__list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
}

.nav__item {
    position: relative;
}

.nav__link {
    display: block;
    padding: 14px 16px;
    font-weight: 700;
    text-transform: uppercase;
    color: #686868;
    letter-spacing: -0.2px;
}

.nav__item:hover .nav__link {
    color: var(--primary-dark);
}

.nav__dropdown {
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 220px;
    background: #f5f6f6;
    border: 1px solid var(--border);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    list-style: none;
    padding: 8px 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 40;
}

.nav__dropdown li a {
    display: block;
    padding: 10px 14px;
    font-weight: 600;
    color: var(--muted);
}

.nav__dropdown li a:hover {
    background: #fff;
    color: var(--primary-dark);
}

.nav__item:hover .nav__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hero {
    height: 170px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-bottom: 2px solid var(--primary);
}

.alert-banner {
    background: #fff6d2;
    border-bottom: 1px solid #f0e4aa;
    padding: 12px 0;
}

.alert-banner__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.alert-banner__text {
    font-weight: 700;
    color: #5b5b5b;
}

.layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 28px;
    padding: 20px 0 40px;
}

.layout__main,
.layout__side {
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.06);
}

.feature-card__media {
    height: 150px;
    background-size: cover;
    background-position: center;
}

.feature-card__body {
    padding: 16px;
    position: relative;
}

.feature-card__icon {
    width: 42px;
    height: 42px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: absolute;
    right: 16px;
    top: -28px;
}

.feature-card__title {
    margin: 8px 0 12px;
    font-size: 20px;
    color: var(--primary-dark);
}

.feature-card__links {
    margin: 0;
    padding: 0 0 0 18px;
    color: var(--muted);
    line-height: 1.5;
}

.news .section-heading h2,
.promo-grid h2,
.form-card h2,
.educare-card h2,
.comunicazioni h2 {
    margin: 0 0 12px;
    color: var(--primary-dark);
    font-size: 22px;
}

.news__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.news-card {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.news-card h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.news-card p {
    margin: 0 0 12px;
    color: var(--muted);
}

.promo-grid {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 20px;
    align-items: start;
}

.promo-grid__aside {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-card,
.video-card,
.form-card,
.educare-card,
.comunicazioni {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05);
}

.form-card--retro {
    background: #f4f4f4;
    border-color: #d0d0d0;
    padding: 0;
    overflow: hidden;
}

.form-card__banner {
    display: flex;
    align-items: center;
    background: #353535;
    color: #f26f21;
    padding: 12px 16px;
    gap: 10px;
}

.form-card__badge {
    width: 28px;
    height: 36px;
    background: #f26f21;
    color: #fff;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(0 0, 100% 0, 100% 80%, 0 100%);
    font-size: 18px;
    line-height: 1;
}

.form-card__banner-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.form-card--retro form {
    padding: 16px;
}

.info-card img,
.educare-card img,
.video-card img {
    width: 100%;
    border-radius: 8px;
    display: block;
}

.info-card p,
.video-card p,
.educare-card p {
    color: var(--muted);
    line-height: 1.5;
}

.video-card__thumb {
    margin: 14px 0;
}

.form-card form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-card label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    color: var(--text);
}

.form-card input,
.form-card select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.form-card__row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.form-card__col .hint {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
}

.form-note {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
}

.form-note--error {
    color: #c0392b;
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

.captcha-img {
    border: 1px solid #7f7f7f;
    height: 46px;
    width: 140px;
    object-fit: cover;
}

.button {
    display: inline-block;
    padding: 10px 16px;
    background: linear-gradient(90deg, var(--primary) 0%, #4fb1d5 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    cursor: pointer;
    text-align: center;
}

.profile-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
}

.profile-card__header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.profile-card__user {
    display: flex;
    gap: 14px;
    align-items: center;
}

.profile-card__avatar img,
.avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 20px;
}

.profile-card__status {
    margin-left: auto;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: inline-block;
}

.status-badge--success {
    background: #d7f5df;
    color: #207a3b;
    border: 1px solid #b6e6c7;
}

.status-badge--error {
    background: #f9d6d6;
    color: #a42f2f;
    border: 1px solid #f0b5b5;
}

.muted {
    color: var(--muted);
    margin: 2px 0 0;
}

.profile-card__body {
    display: grid;
    gap: 10px;
}

.profile-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-weight: 600;
}

.profile-row .label {
    color: var(--muted);
    font-weight: 600;
}

.button--ghost {
    background: #fff;
    color: var(--primary-dark);
    border: 1px solid var(--primary);
}

.button--disabled {
    background: #d6d6d6;
    border: 1px solid #c0c0c0;
    color: #707070;
}

.button--text {
    background: none;
    color: var(--primary-dark);
    padding: 0;
    border: none;
}

.comunicazioni__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comunicazioni__date {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.logo-strip {
    padding: 10px 0 24px;
}

.logo-strip ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.logo-strip img {
    height: 46px;
    width: auto;
    filter: grayscale(10%);
    transition: filter 0.2s ease;
}

.logo-strip a:hover img {
    filter: grayscale(0%);
}

.prefooter {
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.prefooter__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    gap: 12px;
}

.prefooter__links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    padding: 0;
    font-weight: 600;
}

.prefooter__social {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--muted);
}

.prefooter__social img {
    height: 28px;
    width: auto;
}

.footer {
    background: #000;
    padding: 24px 0 32px;
}

.footer__inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.footer__col h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    margin: 0 0 10px;
}

.footer__icon {
    width: 28px;
    height: 28px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: inline-block;
}

.footer__col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.footer__col a {
    color: var(--muted);
}

.footer__col a:hover {
    color: var(--primary-dark);
}

@media (max-width: 1024px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .promo-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .nav-toggle {
        display: inline-block;
    }

    .nav__list {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 10px 0;
    }

    .nav__list.is-open {
        display: flex;
    }

    .nav__item {
        width: 100%;
    }

    .nav__dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding-left: 12px;
    }

    .logo-row {
        flex-direction: column;
    }

    .topbar__inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    .alert-banner__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-card__row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
