:root {
    --primary-green: #00643a;
    --secondary-green: #1e9e12;
    --accent-yellow: #f1b700;
    --text-color: #233027;
    --light-bg: #f6f7f3;
    --white: #ffffff;
    --dark-grey: #2f3432;
    --muted: #6a6f6c;
    --page-gutter: clamp(8px, 1.5vw, 20px);
    --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease-out;
}

@keyframes breathe {
    0%, 100% {
        opacity: 1;
        filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
    }
    50% {
        opacity: 0.95;
        filter: drop-shadow(0 8px 20px rgba(241, 183, 0, 0.25));
    }
}

@keyframes tiltHover {
    0%, 100% {
        transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
    }
    50% {
        transform: perspective(1000px) rotateX(2deg) rotateY(-3deg);
    }
}

@keyframes zoomInImage {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.08);
    }
}

@keyframes saturationPulse {
    0%, 100% {
        filter: saturate(1) brightness(1);
    }
    50% {
        filter: saturate(1.2) brightness(1.05);
    }
}

@keyframes imageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes cardReveal {
    0% {
        opacity: 0;
        background-position: 100% 0;
    }
    100% {
        opacity: 1;
        background-position: -100% 0;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(0, 100, 58, 0.15);
    }
    50% {
        box-shadow: 0 15px 40px rgba(0, 100, 58, 0.25);
    }
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes floatHover {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Source Sans 3", "Segoe UI", Tahoma, sans-serif;
    background: linear-gradient(135deg, #fdfcf7, #f2f5ef 40%, #e9efe5 100%);
    background-attachment: fixed;
    color: var(--text-color);
    font-size: 17px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    animation: fadeInDown 0.8s ease-out;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--secondary-green);
    text-decoration: none;
}

a:hover {
    color: var(--primary-green);
}

.site-header {
    position: relative;
    background: linear-gradient(135deg, var(--primary-green) 0%, #004d2e 100%);
    color: var(--white);
    border-bottom: 6px solid #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    animation: slideInRight 0.6s ease-out;
    transition: var(--transition-smooth);
}

.header-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(241, 183, 0, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(30, 158, 18, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.header-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 16px 6vw 12px;
    min-height: 96px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition-fast);
    animation: fadeInDown 0.8s ease-out 0.1s both;
}

.logo:hover {
    transform: scale(1.03);
    filter: drop-shadow(0 8px 24px rgba(241, 183, 0, 0.4));
}

.logo:hover img {
    animation: tiltHover 0.6s ease-in-out;
}

.logo img {
    animation: fadeInDown 0.8s ease-out 0.3s both, breathe 3s ease-in-out infinite;
    width: clamp(72px, 9vw, 110px);
    height: auto;
    transition: var(--transition-smooth);
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.1));
    cursor: pointer;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1;
}

.logo-name {
    font-family: 'Source Sans 3', Arial, sans-serif;
    font-size: clamp(1.6rem, 3.2vw, 2.6rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.04em;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.3);
    line-height: 1.05;
}

.logo-cisl {
    color: #4fc870;
}

.logo-scuola {
    color: #CE2B37;
}

.logo-provinces {
    font-family: 'Source Sans 3', Arial, sans-serif;
    font-size: clamp(0.62rem, 1vw, 0.82rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 4px;
}

.logo-sede {
    display: block;
    font-family: 'Source Sans 3', Arial, sans-serif;
    font-size: clamp(0.55rem, 0.9vw, 0.72rem);
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 2px;
}

.title-block {
    text-align: center;
    flex: 1;
    animation: fadeInDown 0.8s ease-out 0.2s both;
}

.site-title {
    font-family: "Playfair Display", "Merriweather", serif;
    font-size: clamp(1.4rem, 2.1vw, 2.1rem);
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.03em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1.1;
    transition: var(--transition-smooth);
}

.site-title:hover {
    text-shadow: 3px 3px 12px rgba(241, 183, 0, 0.4);
    transform: scale(1.02);
}

.site-subtitle {
    display: none;
}

.site-provinces {
    font-size: 0.92rem;
    margin: 4px 0 6px;
    color: #b8e5d9;
    font-weight: 500;
    letter-spacing: 0.08em;
}

.site-tagline {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.15rem, 1.7vw, 1.5rem);
    font-weight: 600;
    font-style: italic;
    margin: 6px 0 0;
    color: #f0f8f5;
    line-height: 1.55;
    letter-spacing: 0.01em;
    text-align: center;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 6px rgba(0,0,0,0.25);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-form {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: var(--transition-smooth);
}

.search-form:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.search-form input {
    border: none;
    background: transparent;
    color: var(--white);
    font-size: 0.95rem;
    padding-right: 28px;
    width: 170px;
}

.search-form input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-form input:focus {
    outline: none;
}

.btn-icon {
    position: absolute;
    right: 10px;
    width: 22px;
    height: 22px;
    border: none;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M10 18a8 8 0 1 1 5.293-14.293A8 8 0 0 1 10 18zm0-2a6 6 0 1 0 0-12 6 6 0 0 0 0 12zm10.707 5.293-4.243-4.243 1.414-1.414 4.243 4.243-1.414 1.414z"/></svg>') no-repeat center;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.btn-login {
    background: var(--accent-yellow);
    color: #2b2b2b;
}

.btn-login:hover {
    background: #ffc700;
    box-shadow: 0 10px 24px rgba(241, 183, 0, 0.35);
}

.btn-ghost {
    background: transparent;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.15);
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 10px 6vw 12px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.08));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.site-nav a {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.85);
    padding: 8px 14px;
    border-radius: 999px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.site-nav a::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(241, 183, 0, 0.3);
    transition: left 0.3s ease;
    z-index: -1;
}

.site-nav a:hover::before {
    left: 0;
}

.site-nav a.active,
.site-nav a:hover {
    background: #4fc870;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(79, 200, 112, 0.35);
}

.main-content {
    display: block;
    padding-bottom: 40px;
}

.main-content > .section {
    width: calc(100% - (var(--page-gutter) * 2));
    margin-left: auto;
    margin-right: auto;
}

.page-hero {
    position: relative;
    overflow: hidden;
    min-height: min(68vh, 740px);
    margin: 0 0 44px;
    background: #173125;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    isolation: isolate;
}

.page-hero:hover {
    transform: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.page-hero::before {
    display: none;
}

.page-hero::after {
    display: none;
}

.page-hero-slides,
.page-hero-overlay,
.page-hero-content,
.page-hero-badge,
.page-hero-indicators {
    position: absolute;
}

.page-hero-slides,
.page-hero-overlay {
    inset: 0;
}

.page-hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.03);
    transition: opacity 0.8s ease, transform 6s ease;
}

.page-hero-slide.is-active {
    opacity: 1;
    transform: scale(1);
}

.page-hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.9) contrast(1.02) brightness(0.78);
}

.page-hero-overlay {
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(14, 31, 24, 0.82) 0%, rgba(14, 31, 24, 0.48) 38%, rgba(14, 31, 24, 0.12) 65%, rgba(14, 31, 24, 0.55) 100%),
        linear-gradient(0deg, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.18) 45%, rgba(0, 0, 0, 0.04) 100%);
}

.page-hero-content {
    z-index: 2;
    left: 6vw;
    right: 6vw;
    bottom: 78px;
    max-width: 720px;
    color: var(--white);
}

.page-hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(0, 100, 58, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #e8f7ef;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
    font-weight: 700;
}

.page-hero h2 {
    position: relative;
    font-family: "Playfair Display", "Merriweather", serif;
    margin: 0 0 16px;
    font-size: clamp(2.1rem, 4.1vw, 4rem);
    line-height: 1.04;
    color: var(--white);
    max-width: 18ch;
    text-wrap: balance;
    text-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.page-hero:hover h2 {
    color: var(--white);
    text-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.page-hero p {
    position: relative;
    max-width: 620px;
    margin: 0 0 24px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.75;
    font-size: 1.08rem;
    text-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.page-hero .btn-primary {
    background: var(--secondary-green);
}

.page-hero .btn-secondary {
    background: rgba(255, 255, 255, 0.95);
}

.page-hero-badge {
    z-index: 2;
    right: 5vw;
    bottom: 30px;
    max-width: min(58vw, 940px);
    padding: 18px 24px;
    border-radius: 16px 0 0 16px;
    background: rgba(30, 158, 18, 0.86);
    color: var(--white);
    font-family: "Playfair Display", "Merriweather", serif;
    font-size: clamp(1.2rem, 2.8vw, 3.2rem);
    line-height: 1.05;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.page-hero-indicators {
    z-index: 2;
    left: 6vw;
    bottom: 30px;
    display: flex;
    gap: 10px;
}

.page-hero-indicator {
    width: 14px;
    height: 14px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.22);
    cursor: pointer;
    transition: var(--transition-fast);
}

.page-hero-indicator.is-active {
    width: 44px;
    background: var(--accent-yellow);
    border-color: var(--accent-yellow);
}

.card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 100, 58, 0.08);
    transition: var(--transition-smooth);
    animation: fadeInUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card p {
    margin: 4px 0;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-green), var(--accent-yellow));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(0, 100, 58, 0.15);
    border-color: rgba(30, 158, 18, 0.3);
}

.card h3 {
    margin: 0 0 12px 0;
    font-family: "Playfair Display", "Merriweather", serif;
    font-size: 1.3rem;
    color: var(--primary-green);
    transition: var(--transition-smooth);
}

.card:hover h3 {
    color: var(--secondary-green);
}

.btn-primary {
    background: var(--secondary-green);
    color: var(--white);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-green);
    border: 1px solid rgba(0, 100, 58, 0.2);
}

.btn-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.btn-danger:hover {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.section {
    margin: 32px 0;
}

.section-title {
    font-family: "Playfair Display", "Merriweather", serif;
    font-size: 2.4rem;
    margin-bottom: 28px;
    color: var(--primary-green);
    position: relative;
    padding-bottom: 12px;
    animation: fadeInUp 0.6s ease-out both;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 90px;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-green), var(--accent-yellow));
    border-radius: 2px;
    transition: width 0.4s ease;
}

.section:hover .section-title::after {
    width: 150px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

/* ── Spaziatura prima sezione dopo hero ────────────── */
.section--featured {
    margin-top: 48px;
}

/* ── Sportello in evidenza ───────────────────────────── */
@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 0 0 rgba(79, 200, 112, 0.6); }
    50%       { box-shadow: 0 0 0 8px rgba(79, 200, 112, 0); }
}

.sportello-new-badge {
    position: absolute;
    top: -14px;
    left: 28px;
    background: #4fc870;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 999px;
    animation: pulse-badge 2s ease-in-out infinite;
    white-space: nowrap;
}

.sportello-banner {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    border-radius: 18px;
    padding: 32px 36px;
    display: flex;
    align-items: center;
    gap: 28px;
    color: var(--white);
    box-shadow: 0 10px 32px rgba(0, 100, 58, 0.25);
    animation: fadeInUp 0.7s ease-out both;
    flex-wrap: wrap;
}

.sportello-banner-icon {
    font-size: 3rem;
    flex-shrink: 0;
    line-height: 1;
}

.sportello-banner-body {
    flex: 1;
    min-width: 200px;
}

.sportello-banner-kicker {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.8;
    margin-bottom: 4px;
}

.sportello-banner-title {
    font-family: "Playfair Display", "Merriweather", serif;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--white);
}

.sportello-banner-desc {
    margin: 0 0 10px 0;
    opacity: 0.92;
    font-size: 0.97rem;
    line-height: 1.55;
}

.sportello-banner-address {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 0.9rem;
    font-weight: 600;
}

.sportello-banner-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.updates-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 22px 26px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.updates-header {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.updates-badge {
    position: static;
    animation: pulse-badge 2s ease-in-out infinite;
}

.updates-title {
    margin: 0;
    font-family: "Playfair Display", "Merriweather", serif;
    font-size: 1.2rem;
    color: var(--white);
    margin-right: auto;
}

.updates-hint {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.78);
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.updates-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}

.updates-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,.12);
    border-radius: 12px;
    padding: 12px 14px;
    min-width: 0;
}

.updates-icon {
    font-size: 1.8rem;
}

.updates-card-title {
    font-size: 1.02rem;
    margin-bottom: 2px;
}

.updates-card-desc {
    font-size: 0.86rem;
    margin: 0;
}

.updates-card-address {
    margin-top: 4px;
    font-size: 0.8rem;
}

@media (max-width: 900px) {
    .updates-banner {
        padding: 18px 16px;
    }

    .updates-hint {
        display: none;
    }

    .updates-grid {
        grid-template-columns: 1fr;
    }

    .updates-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .updates-card .sportello-banner-body {
        width: 100%;
        min-width: 0;
    }

    .updates-card .sportello-banner-actions {
        width: 100%;
    }

    .updates-card .btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 1180px) {
    .updates-hint {
        display: none;
    }

    .updates-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .updates-grid {
        grid-template-columns: 1fr;
    }
}

.btn-white {
    background: var(--white);
    color: var(--primary-green);
    font-weight: 700;
    border: none;
}

.btn-white:hover {
    background: var(--accent-yellow);
    color: var(--primary-green);
}

/* ── Card read-more link ────────────────────────────── */
.card-read-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--secondary-green);
    text-decoration: none;
    border-bottom: 2px solid var(--accent-yellow);
    padding-bottom: 2px;
    transition: var(--transition-fast);
}

.card-read-more:hover {
    color: var(--primary-green);
    border-bottom-color: var(--secondary-green);
    gap: 8px;
}

.news-ticker {
    background: var(--white);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 200px;
    height: auto;
    border: 1px solid rgba(30, 158, 18, 0.1);
    position: relative;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.news-ticker::before,
.news-ticker::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
}

.news-ticker::before {
    top: 0;
    background: linear-gradient(90deg, transparent, var(--secondary-green), transparent);
}

.news-ticker::after {
    bottom: 0;
    background: linear-gradient(90deg, transparent, var(--accent-yellow), transparent);
}

.news-ticker-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.news-ticker-item {
    padding: 14px 0 16px;
    border-bottom: 1px solid #e5e5e5;
    transition: var(--transition-smooth);
    cursor: default;
}

.news-ticker-item:hover {
    background: linear-gradient(90deg, rgba(30, 158, 18, 0.05), transparent);
}

.news-ticker-item:last-child {
    border-bottom: none;
}

.news-ticker-title {
    margin: 4px 0 8px;
    font-family: "Source Sans 3", "Segoe UI", Tahoma, sans-serif;
    font-size: 1.04rem;
    line-height: 1.3;
    font-weight: 700;
}

.news-ticker-title a {
    color: var(--secondary-green);
    text-decoration: none;
}

.news-ticker-title a:hover {
    color: var(--primary-green);
    text-decoration: underline;
}

.news-summary--compact {
    margin-bottom: 10px;
    line-height: 1.6;
}

.news-ticker-footer {
    display: flex;
    justify-content: flex-start;
}

/* ── News list layout ──────────────────────────────────────── */
.news-list {
    display: flex;
    flex-direction: column;
}

.news-item {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    padding: 28px 0;
    border-bottom: 1px solid #e0e0e0;
}

.news-thumb {
    position: relative;
    flex-shrink: 0;
    width: 340px;
    height: 220px;
    border-radius: 8px;
    overflow: hidden;
    background: #eef3ef;
}

.news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #d4e6dc, #eef3ef);
    font-size: 3rem;
}

.news-date-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    background: #c0392b;
    color: #fff;
    text-align: center;
    padding: 8px 14px;
    min-width: 58px;
    line-height: 1;
}

.news-date-badge .day {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
}

.news-date-badge .month {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: capitalize;
    margin-top: 3px;
}

.news-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 4px;
}

.news-item h3,
.news-item h2 {
    margin: 0 0 10px;
    font-family: "Playfair Display", "Merriweather", serif;
}

.news-item h3 a {
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.news-item h3 a:hover {
    color: var(--secondary-green);
}

.news-summary {
    line-height: 1.7;
    color: var(--muted);
    font-size: 1rem;
    margin: 0 0 18px;
}

.btn-leggi-tutto {
    display: inline-block;
    border: 1.5px solid var(--primary-green);
    color: var(--primary-green);
    padding: 8px 22px;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-fast);
    align-self: flex-start;
    margin-top: auto;
}

.btn-leggi-tutto:hover {
    background: var(--primary-green);
    color: #fff;
}

.news-media-image {
    display: block;
    width: 100%;
    border-radius: 12px;
    margin: 10px 0 14px;
    border: 1px solid #d8e2dd;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.news-embed-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 10px 0 14px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #d8e2dd;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
    background: #eef3ef;
}

.news-embed {
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 700px) {
    .news-item {
        flex-direction: column;
        gap: 0;
    }
    .news-thumb {
        width: 100%;
        height: 200px;
        border-radius: 8px 8px 0 0;
    }
}

.form-container {
    background: var(--white);
    padding: 28px;
    border-radius: 18px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
    max-width: 720px;
}

/* Login tabs */
.login-tabs {
    display: flex;
    gap: 0;
    max-width: 720px;
    margin-bottom: -1px;
}
.login-tab {
    flex: 1;
    padding: 10px 16px;
    background: #f3f4f2;
    border: 1px solid #dde0dc;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted, #666);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    transition: background .15s;
}
.login-tab--active {
    background: var(--white);
    color: var(--primary-green);
    font-weight: 700;
    border-color: #dde0dc;
    border-bottom-color: var(--white);
    z-index: 1;
}
.login-tab:not(.login-tab--active):hover { background: #e8ede8; }

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #cfd8d3;
    border-radius: 8px;
    padding: 10px;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 140px;
    resize: vertical;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.admin-form-grid .form-group {
    margin-bottom: 0;
}

.form-span-2 {
    grid-column: 1 / -1;
}

.admin-form-grid .filter-section {
    margin-top: 0;
}

.admin-form-actions {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-section {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #d8e2dd;
    border-radius: 14px;
    background: #f8fbf9;
}

.filter-section h4 {
    margin: 0 0 8px;
    color: var(--secondary-green);
}

.filter-intro {
    margin: 0 0 14px;
    color: #495a52;
}

.filter-fieldset {
    margin: 0 0 14px;
    padding: 14px;
    border: 1px solid #d8e2dd;
    border-radius: 10px;
}

.filter-fieldset legend {
    padding: 0 8px;
    font-weight: 700;
    color: var(--secondary-green);
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
}

.checkbox-group label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.checkbox-group input {
    width: auto;
}

.filter-section.filter-section-compact {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 10px;
    align-items: start;
}

.filter-section.filter-section-compact h4 {
    grid-column: 1 / -1;
    margin: 0;
}

.filter-section.filter-section-compact .filter-intro {
    grid-column: 1 / -1;
    margin: 0;
    font-size: .92rem;
}

.filter-section.filter-section-compact .filter-fieldset {
    margin: 0;
    padding: 8px 10px;
}

.filter-section.filter-section-compact .checkbox-group {
    gap: 6px 12px;
}

.filter-section.filter-section-compact .form-group {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.news-form-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.news-form-top .news-publish-inline {
    margin: 0;
    min-width: 250px;
    max-width: 310px;
    width: 100%;
}

.news-form-top .news-publish-inline label {
    margin-bottom: 4px;
    font-size: .82rem;
}

.news-form-top .news-sezioni-inline {
    margin: 0;
    min-width: 320px;
    max-width: 460px;
    width: 100%;
    padding: 8px 10px;
}

.news-form-top .news-sezioni-inline legend {
    font-size: .82rem;
    font-weight: 700;
}

.news-form-top .news-sezioni-inline .checkbox-group {
    gap: 8px 16px;
}

.news-form-top .news-sezioni-inline .checkbox-group label {
    font-weight: 500;
}

@media (max-width: 980px) {
    .filter-section.filter-section-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .news-form-top {
        flex-direction: column;
        align-items: stretch;
    }

    .news-form-top .news-publish-inline {
        max-width: none;
        min-width: 0;
    }

    .news-form-top .news-sezioni-inline {
        max-width: none;
        min-width: 0;
    }

    .filter-section.filter-section-compact {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.tabs a {
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--dark-grey);
    font-weight: 600;
}

.tabs a.active,
.tabs a:hover {
    background: var(--secondary-green);
    color: var(--white);
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}

.table th,
.table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e5e5e5;
    text-align: left;
    font-size: 0.95rem;
}

.table th {
    background: #f0f3ee;
}

.table tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.table-actions form {
    margin: 0;
}

.btn-action-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1;
}

.btn-action-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.admin-grid {
    display: grid;
    gap: 22px;
}

.admin-card-wide {
    max-width: none;
}

.admin-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.admin-toolbar-title {
    margin: 0;
    flex-shrink: 0;
}

.admin-toolbar-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-table-wrap {
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.admin-bulk-bar {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.admin-inline-alert {
    display: none;
    align-items: center;
    gap: 6px;
    background: #fef9c3;
    border: 1px solid #fde047;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: .85rem;
    color: #854d0e;
}

.admin-inline-alert.is-visible {
    display: inline-flex;
}

/* Evita clipping e offset dei modal fixed dentro il box Appuntamenti */
#section-appointments.card {
    overflow: visible;
    transform: none;
    animation: none;
}

#section-appointments.card:hover {
    transform: none;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 100, 58, 0.08);
}

.alerts-stack {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.alert {
    display: grid;
    grid-template-columns: 32px 1fr;
    align-items: start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    border-left: 5px solid transparent;
    box-shadow: 0 8px 24px rgba(20, 30, 24, 0.08);
    animation: fadeInDown 0.28s ease-out;
}

.alert-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
}

.alert-text {
    line-height: 1.45;
}

.alert-success {
    background: linear-gradient(180deg, #ebf8e6 0%, #def2d8 100%);
    color: #1f5421;
    border: 1px solid #b9e0b4;
    border-left-color: #239143;
}

.alert-success .alert-icon {
    color: #ffffff;
    background: #239143;
}

.alert-error {
    background: linear-gradient(180deg, #fde9ea 0%, #f9d6d9 100%);
    color: #6a121b;
    border: 1px solid #f1b7bf;
    border-left-color: #b22433;
}

.alert-error .alert-icon {
    color: #ffffff;
    background: #b22433;
}

.confirm-modal-open {
    overflow: hidden;
}

.confirm-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(17, 28, 21, 0.45);
    backdrop-filter: blur(2px);
    display: grid;
    place-items: center;
    padding: 24px;
    overflow-y: auto;
}

.confirm-modal-backdrop[hidden] {
    display: none !important;
}

.confirm-modal {
    width: min(420px, 100%);
    background: linear-gradient(180deg, #ffffff 0%, #f5f8f3 100%);
    border: 1px solid #d5dfd2;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(9, 24, 14, 0.28);
    padding: 22px;
    animation: fadeInDown 0.22s ease-out;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
}

.confirm-modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(135deg, #1f8b39 0%, #25a245 100%);
    box-shadow: 0 8px 20px rgba(31, 139, 57, 0.3);
}

.confirm-modal h3 {
    margin: 12px 0 8px;
    color: #153924;
}

.confirm-modal p {
    margin: 0;
    color: #2f4738;
    line-height: 1.45;
}

.confirm-modal-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 520px) {
    .confirm-modal {
        padding: 18px;
    }

    .confirm-modal-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }
}

.site-footer {
    background: var(--primary-green);
    color: #e2e2e2;
    padding: 24px 4vw 18px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px 24px;
    align-items: start;
}

.footer-grid h3,
.footer-grid h4 {
    margin: 0 0 10px;
}

.footer-grid p {
    margin: 0 0 8px;
    line-height: 1.45;
}

.footer-grid p:last-child {
    margin-bottom: 0;
}

.footer-bottom {
    margin-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 10px;
    font-size: 0.9rem;
}

@media (max-width: 760px) {
    .site-footer {
        padding: 22px 5vw 16px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 14px 18px;
    }

    .footer-grid h3,
    .footer-grid h4 {
        margin-bottom: 8px;
    }

    .footer-grid p {
        margin-bottom: 7px;
        line-height: 1.4;
    }
}

@media (max-width: 520px) {
    .site-footer {
        padding-inline: 16px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .footer-bottom {
        margin-top: 14px;
        padding-top: 9px;
    }
}

.image-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, rgba(30, 158, 18, 0.08) 0%, rgba(241, 183, 0, 0.08) 100%);
    border-radius: 16px;
    border: 2px dashed rgba(30, 158, 18, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.image-placeholder:hover {
    border-color: rgba(30, 158, 18, 0.5);
    background: linear-gradient(135deg, rgba(30, 158, 18, 0.15) 0%, rgba(241, 183, 0, 0.15) 100%);
    box-shadow: 0 8px 16px rgba(30, 158, 18, 0.12);
    transform: translateY(-2px);
}

.image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    transition: var(--transition-smooth);
    animation: imageSlideIn 0.6s ease-out;
}

.card-image {
    height: 160px;
    margin-bottom: 16px;
}

.image-placeholder:hover img {
    transform: scale(1.08);
    filter: saturate(1.15) brightness(1.08);
}

.image-icon {
    font-size: 2.5rem;
    margin-right: 12px;
    opacity: 0.6;
}

@media (max-width: 900px) {
    .header-top {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding-top: 16px;
    }

    .title-block {
        order: 2;
    }

    .header-actions {
        order: 3;
        flex-wrap: wrap;
        justify-content: center;
    }

    .search-form input {
        width: 160px;
    }

    .site-tagline {
        max-width: 100%;
    }

    .page-hero {
        min-height: 560px;
    }

    .page-hero-content {
        bottom: 92px;
    }

    .page-hero-badge {
        right: 24px;
        left: 24px;
        max-width: none;
        border-radius: 14px;
        font-size: clamp(1.1rem, 4vw, 2.2rem);
    }
}

@media (max-width: 768px) {
    .site-header {
        border-bottom-width: 4px;
    }

    .header-top {
        gap: 12px;
        padding: 14px 4vw 10px;
    }

    .logo {
        gap: 14px;
    }

    .logo img {
        width: 72px;
    }

    .logo-name {
        font-size: 1.55rem;
    }

    .logo-provinces {
        font-size: 0.62rem;
        letter-spacing: 0.05em;
    }

    .title-block {
        width: 100%;
    }

    .site-tagline {
        max-width: none;
        margin: 0 auto;
        padding: 0 2vw;
        font-size: 0.98rem;
        line-height: 1.4;
    }

    .site-tagline br {
        display: none;
    }

    .header-actions {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        align-items: center;
    }

    .search-form {
        width: 100%;
        padding: 8px 12px;
    }

    .search-form input {
        width: 100%;
        min-width: 0;
        font-size: 0.92rem;
    }

    .header-actions .btn {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 0.92rem;
    }

    .site-nav {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 10px;
        padding: 12px 4vw 14px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .site-nav::-webkit-scrollbar {
        display: none;
    }

    .site-nav a {
        flex: 0 0 auto;
        min-height: 42px;
        padding: 9px 16px;
        text-align: center;
        font-size: 0.78rem;
        line-height: 1;
    }

    .page-hero {
        min-height: 620px;
        margin-top: -10px;
        margin-bottom: 24px;
    }

    .page-hero-content {
        left: 18px;
        right: 18px;
        bottom: 24px;
    }

    .page-hero-kicker {
        margin-bottom: 10px;
        padding: 6px 10px;
        font-size: 0.68rem;
    }

    .page-hero h2 {
        font-size: 2rem;
        line-height: 1.08;
        max-width: 10ch;
        margin-bottom: 12px;
    }

    .page-hero p {
        font-size: 0.95rem;
        line-height: 1.55;
        margin-bottom: 18px;
    }

    .page-hero-badge {
        left: 16px;
        right: 16px;
        top: 8px;
        bottom: auto;
        padding: 12px 16px;
        border-radius: 18px;
        font-size: 0.92rem;
        line-height: 1.35;
        letter-spacing: 0.04em;
    }

    .page-hero-indicators {
        display: none;
    }

    .hero-actions {
        gap: 8px;
    }

    .hero-actions .btn {
        padding: 11px 16px;
        font-size: 0.92rem;
    }
}

@media (max-width: 600px) {
    .logo img {
        width: 64px;
    }

    .logo-name {
        font-size: 1.4rem;
    }

    .logo-provinces {
        font-size: 0.58rem;
    }

    .header-top {
        gap: 10px;
        padding: 12px 4vw 8px;
    }

    .site-title {
        font-size: 1.2rem;
    }

    .site-provinces,
    .site-tagline {
        font-size: 0.9rem;
        line-height: 1.45;
    }

    .site-tagline {
        padding: 0 1vw;
    }

    .site-nav a {
        min-height: 40px;
        padding: 8px 14px;
        font-size: 0.76rem;
    }

    .checkbox-group {
        flex-direction: column;
        gap: 8px;
    }

    .page-hero {
        min-height: 560px;
        margin-top: -12px;
    }

    .page-hero-content {
        left: 16px;
        right: 16px;
        bottom: 22px;
    }

    .page-hero-kicker {
        margin-bottom: 10px;
        padding: 6px 10px;
        font-size: 0.68rem;
    }

    .page-hero p {
        font-size: 0.94rem;
        line-height: 1.55;
        margin-bottom: 18px;
    }

    .page-hero-badge {
        display: none;
    }

    .page-hero-indicators {
        display: none;
    }

    .page-hero h2 {
        font-size: 1.75rem;
        line-height: 1.08;
        max-width: 9ch;
        margin-bottom: 12px;
    }

    .page-hero-badge {
        top: 6px;
        left: 12px;
        right: 12px;
        padding: 10px 14px;
        font-size: 0.84rem;
    }

    .hero-actions {
        gap: 8px;
    }

    .hero-actions .btn {
        padding: 11px 16px;
        font-size: 0.92rem;
    }

    .news-ticker {
        height: 260px;
    }

    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .table th,
    .table td {
        padding: 10px 12px;
    }
}

/* ═══════════════════════════════════════════════════════
   CALENDARIO PRENOTAZIONI
   ═══════════════════════════════════════════════════════ */

/* ── Badges stato ─────────────────────────────────────── */
.badge-on {
    display: inline-block;
    background: #e6f4ec;
    color: #00643a;
    border: 1px solid #a3d9b8;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 2px 10px;
    letter-spacing: .3px;
}
.badge-off {
    display: inline-block;
    background: #fdecea;
    color: #b91c1c;
    border: 1px solid #f5b4b0;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 2px 10px;
    letter-spacing: .3px;
}

/* ── Badge stato appuntamento ────────────────────────── */
.appointment-badge {
    display: inline-block;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
}
.appointment-badge--in_attesa {
    background: #fef9c3;
    color: #92400e;
    border: 1px solid #fcd34d;
}
.appointment-badge--confermato {
    background: #e6f4ec;
    color: #00643a;
    border: 1px solid #a3d9b8;
}
.appointment-badge--rifiutato {
    background: #fdecea;
    color: #b91c1c;
    border: 1px solid #f5b4b0;
}
.appointment-badge--presenza {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
}
.appointment-badge--evaso {
    background: #f3e8ff;
    color: #7c3aed;
    border: 1px solid #c4b5fd;
}
.appointment-badge--assente {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fdba74;
}
.appointment-badge--annullato {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

/* ── btn-sm ───────────────────────────────────────────── */
.btn-sm {
    padding: 5px 12px;
    font-size: 0.85rem;
}
.muted-text { color: var(--muted); }

.appointment-action-box {
    min-width: 250px;
}

.appointment-action-box--focus {
    outline: 2px solid rgba(17, 110, 52, 0.28);
    outline-offset: 3px;
    border-radius: 12px;
    background: rgba(230, 244, 236, 0.55);
    transition: background 0.18s ease, outline-color 0.18s ease;
}

.appointment-admin-note {
    width: 100%;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid #c7d1c7;
    border-radius: 8px;
    font: inherit;
    margin-bottom: 7px;
}

.appointment-action-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
}

.appointment-action-submit {
    display: inline-flex;
}

.appointment-action-submit .btn {
    min-width: unset;
    white-space: nowrap;
}

.appointment-slot-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.admin-form-grid .form-group:has(.appointment-slot-summary:not([hidden])) {
    grid-column: 1 / -1;
}

.appointment-slot-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    font: inherit;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.appointment-slot-chip.is-free {
    background: #e6f4ec;
    color: #1f6b3d;
    border-color: #b8dec5;
}

.appointment-slot-chip.is-occupied {
    background: #fdecea;
    color: #a43b37;
    border-color: #f3c3bf;
}

.appointment-slot-chip.is-selected {
    box-shadow: 0 0 0 2px rgba(17, 110, 52, 0.18);
}

.appointment-slot-chip.is-free:hover,
.appointment-slot-chip.is-free:focus-visible {
    transform: translateY(-1px);
    outline: none;
    box-shadow: 0 0 0 2px rgba(17, 110, 52, 0.12);
}

.appointment-slot-chip:disabled {
    cursor: not-allowed;
    opacity: 0.9;
}

/* ── Radio group ──────────────────────────────────────── */
.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 4px;
}
.radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.95rem;
}

/* ── Intestazione mese ────────────────────────────────── */
.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.cal-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.cal-year-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.cal-year-form label {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 600;
}
.cal-year-form input {
    width: 92px;
    padding: 8px 10px;
    border: 1px solid #ccd5cc;
    border-radius: 8px;
    font: inherit;
    color: var(--text-color);
    background: var(--white);
}
.cal-month-label {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-color);
    text-transform: capitalize;
    min-width: 160px;
    text-align: center;
}
.cal-year-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.cal-month-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8faf8 100%);
    border: 1px solid #dce6dc;
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 6px 18px rgba(35, 48, 39, 0.06);
    min-width: 0;
}
.cal-month-card--current {
    border-color: #8dc6a5;
    box-shadow: 0 10px 26px rgba(0, 100, 58, 0.12);
}
.cal-month-title {
    margin: 0 0 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-color);
    text-align: center;
}

/* ── Griglia calendario ───────────────────────────────── */
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    margin-bottom: 12px;
}
.cal-grid--month {
    margin-bottom: 0;
}
.cal-grid--month .cal-dow {
    font-size: 0.66rem;
    padding: 2px 0 4px;
}
.cal-dow {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 4px 0 6px;
}
.cal-cell {
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1.5px solid transparent;
    transition: transform .12s ease, box-shadow .12s ease;
    user-select: none;
}
.cal-grid--month .cal-cell {
    min-height: 24px;
}
.cal-grid--month .cal-day-num {
    font-size: 0.72rem;
}
.cal-grid--month .cal-day-note {
    margin-top: 1px;
}
.cal-grid--month .cal-day-capacity {
    font-size: 0.54rem;
    line-height: 1;
    margin-top: 3px;
}
.cal-cell--empty { background: transparent; border-color: transparent; }
.cal-cell--past  { background: #f3f4f2; }
/* Giorno neutro (nessuna fascia) — cliccabile per abilitare */
.cal-cell--neutral {
    background: #f3f4f2;
    cursor: pointer;
}
.cal-cell--neutral:hover {
    background: #e8ede8;
    transform: scale(1.06);
}
.cal-cell--noSlot  { background: #f3f4f2; }

/* Verde = solo slot */
.cal-cell--on,
.cal-cell--slot,
.cal-cell--slot-only {
    background: #d1fae5;
    border-color: #16a34a;
    cursor: pointer;
}
.cal-cell--on:hover,
.cal-cell--slot:hover,
.cal-cell--slot-only:hover {
    background: #a7f3d0;
    transform: scale(1.06);
    box-shadow: 0 2px 8px rgba(22,163,74,.2);
}

/* Giallo = solo senza orario */
.cal-cell--fuori-only {
    background: #fef9c3;
    border-color: #ca8a04;
    cursor: pointer;
}
.cal-cell--fuori-only:hover {
    background: #fde68a;
    transform: scale(1.06);
    box-shadow: 0 2px 8px rgba(202,138,4,.2);
}

/* Blu = slot + senza orario */
.cal-cell--both {
    background: #dbeafe;
    border-color: #2563eb;
    cursor: pointer;
}
.cal-cell--both:hover {
    background: #bfdbfe;
    transform: scale(1.06);
    box-shadow: 0 2px 8px rgba(37,99,235,.2);
}

/* Rosso = chiuso — stessa estetica del neutro, solo cursore pointer per riaprire */
.cal-cell--off {
    background: #f3f4f2;
    border-color: #dde0dc;
    cursor: pointer;
}
.cal-cell--off:hover {
    background: #e8ede8;
    transform: scale(1.06);
}

/* Giorno selezionato: bordo spesso scuro, senza sovrascrivere il colore di stato */
.cal-cell--selected {
    outline: 3px solid var(--primary-green);
    outline-offset: -2px;
}
.cal-cell--selected .cal-day-num { color: inherit; font-weight: 800; }

/* Mantieni ben visibile il colore stato anche quando la cella e selezionata */
.cal-cell--selected.cal-cell--slot-only {
    background: #bbf7d0;
    border-color: #16a34a;
}
.cal-cell--selected.cal-cell--fuori-only {
    background: #fde68a;
    border-color: #ca8a04;
    outline-color: #ca8a04;
}
.cal-cell--selected.cal-cell--neutral,
.cal-cell--selected.cal-cell--off {
    background: #f3f4f2;
    border-color: #d1d5db;
    outline-color: #9ca3af;
}

/* Oggi */
.cal-cell--today .cal-day-num {
    font-weight: 800;
    text-decoration: underline;
}

.cal-cell--past .cal-day-num { color: #c0c5c2; }
.cal-day-num {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
}
.cal-day-note {
    font-size: 0.5rem;
    color: var(--primary-green);
    line-height: 1;
    margin-top: 2px;
}
.cal-day-capacity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 2px 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--text-color);
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 1;
    margin-top: 4px;
}
.cal-cell--selected .cal-day-capacity {
    background: rgba(255, 255, 255, 0.82);
    color: var(--text-color);
}
.cal-month-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}
.cal-stat-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef3ee;
    color: var(--text-color);
    font-size: 0.74rem;
    font-weight: 600;
}
.cal-stat-pill--muted {
    background: #f3f4f2;
    color: var(--muted);
}
.appointment-week-panel {
    display: grid;
    gap: 12px;
}
.appointment-view-toggle.is-active {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: #fff;
}
.appointment-week-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
}
.appointment-week-day {
    display: grid;
    gap: 4px;
    align-content: start;
    min-height: 92px;
    padding: 12px;
    border: 1px solid #d8e4d9;
    border-radius: 12px;
    background: #f9fbf9;
    color: var(--text-color);
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.appointment-week-day:hover {
    border-color: #b8d0bc;
    background: #f0f6f1;
    transform: translateY(-1px);
}
.appointment-week-day--busy {
    background: #edf7ef;
    border-color: #b7d7bf;
}
.appointment-week-day--active {
    background: #dff0e5;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px rgba(17, 110, 52, 0.12);
}
.appointment-week-day__name {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.appointment-week-day__date {
    font-size: 1rem;
    font-weight: 700;
}
.appointment-week-day__count {
    font-size: 0.82rem;
    color: var(--muted);
}
.cal-day-appointments {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #dde6dd;
}
.cal-day-appointments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.cal-day-appointments-header h5 {
    margin: 0;
    font-size: 0.98rem;
    color: var(--text-color);
}
.cal-day-appointments-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.appointment-day-agenda {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}
.appointment-day-agenda__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dde6dd;
    border-radius: 12px;
    background: #f8fbf8;
    color: var(--text-color);
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
}
.appointment-day-agenda__item:hover {
    border-color: #bfd6c3;
    background: #f1f7f2;
}
.appointment-day-agenda__time {
    min-width: 56px;
    font-weight: 700;
    color: var(--primary-green);
}
.appointment-day-agenda__summary {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.appointment-day-agenda__status {
    justify-self: end;
}
.appointment-quick-actions {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}
.appointment-quick-admin-note {
    flex: 1 1 220px;
    min-width: 180px;
}
.appointment-quick-actions--compact {
    grid-column: auto;
    justify-self: end;
    margin-top: 0;
}
.appointment-quick-actions--compact .appointment-quick-admin-note {
    display: none;
}
.appointment-quick-actions__form {
    margin: 0;
}
.cal-day-appointments-list {
    display: grid;
    gap: 10px;
}
.cal-appointment-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    align-items: start;
    padding: 12px 14px;
    border: 1px solid #dde6dd;
    border-radius: 12px;
    background: #fbfcfb;
}
.cal-appointment-row--interactive {
    cursor: pointer;
}
.cal-appointment-row--interactive:hover {
    border-color: #bfd6c3;
    background: #f3f8f4;
}
.appointment-row-highlight {
    border-color: #7fbc93 !important;
    background: #eef8f1 !important;
    box-shadow: 0 0 0 2px rgba(127, 188, 147, 0.16);
    animation: pulseGlow 1.1s ease-out 1;
}
tr.appointment-row-highlight > td {
    background: #eef8f1;
}
.cal-appointment-meta {
    display: grid;
    gap: 2px;
}
.cal-appointment-meta strong {
    color: var(--text-color);
    font-size: 0.96rem;
}
.cal-appointment-meta span,
.cal-appointment-meta small {
    color: var(--muted);
}
.cal-appointment-note {
    grid-column: 1 / -1;
    color: var(--text-color);
    font-size: 0.9rem;
    line-height: 1.5;
    padding-top: 4px;
}

/* ── Legenda ──────────────────────────────────────────── */
.cal-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 8px;
}
.cal-legend-item { display: flex; align-items: center; gap: 5px; }
.cal-dot {
    width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0;
    border: 1.5px solid transparent;
}
.cal-dot--open     { background: #e6f4ec; border-color: #a3d9b8; }
.cal-dot--closed   { background: #fdecea; border-color: #f5b4b0; }
.cal-dot--selected { background: var(--primary-green); border-color: var(--primary-green); }

/* ── Griglia slot orari ───────────────────────────────── */
.slots-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 8px;
}
.slot-btn {
    background: #e6f4ec;
    color: var(--primary-green);
    border: 1.5px solid #a3d9b8;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .14s, transform .12s;
    font-family: inherit;
}
.slot-btn:hover {
    background: var(--primary-green);
    color: #fff;
    transform: translateY(-2px);
}
.slot-btn--occupied {
    background: #f3f4f2;
    color: #c0c5c2;
    border-color: #e0e2e0;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* ── Layout pagina prenota ────────────────────────────── */
.prenota-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
.prenota-cal-wrap { max-width: 360px; justify-self: start; width: 100%; }

/* ── Griglia selezione sede ───────────────────────────── */
.sede-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 16px;
}
.sede-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 18px 20px;
    background: #fff;
    border: 2px solid #c8e6d0;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: border-color .18s, background .18s, box-shadow .18s;
    font-family: inherit;
    width: 100%;
}
.sede-card:hover, .sede-card:focus-visible {
    border-color: var(--primary-green, #2a6b4f);
    background: #f0faf4;
    box-shadow: 0 2px 12px rgba(42,107,79,.12);
    outline: none;
}
.sede-card-pin {
    font-size: 1.4rem;
    line-height: 1;
}
.sede-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-green, #2a6b4f);
}
.sede-card-addr {
    font-size: .88rem;
    color: #444;
    line-height: 1.4;
}
.sede-card-orari {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .83rem;
    color: #666;
    margin-top: 2px;
}
.sede-card-orari svg {
    flex-shrink: 0;
    color: var(--primary-green, #2a6b4f);
}
@media (max-width: 540px) {
    .sede-cards-grid { grid-template-columns: 1fr; }
}

/* ── Box riepilogo selezione ──────────────────────────── */
.bk-summary-box {
    background: var(--light-bg);
    border: 1.5px solid #a3d9b8;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 700;
    color: var(--primary-green);
    font-size: 1rem;
}

/* ── Form modifica giorno nel calendario admin ────────── */
.cal-day-form {
    margin-top: 20px;
    background: var(--light-bg);
    border: 1.5px solid #ccd5cc;
    border-radius: 12px;
    padding: 20px 24px;
}
.cal-day-form h4 {
    margin: 0 0 16px;
    font-size: 1rem;
    color: var(--text-color);
}
.section-intro {
    color: var(--muted);
    font-size: 1rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

@media (min-width: 700px) {
    .prenota-layout {
        grid-template-columns: auto 1fr;
        align-items: start;
    }
    .prenota-cal-wrap { justify-self: start; }
}

@media (min-width: 641px) and (max-width: 900px) {
    .appointment-week-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .cal-year-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 760px) {
    .cal-year-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .appointment-week-grid {
        grid-template-columns: 1fr;
    }
    .appointment-day-agenda__item {
        grid-template-columns: 1fr;
    }
    .appointment-day-agenda__status {
        justify-self: start;
    }
    .cal-toolbar {
        align-items: stretch;
    }
    .cal-year-form {
        width: 100%;
    }
    .cal-appointment-row {
        grid-template-columns: 1fr;
    }
}

