.mediatori-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 32px !important;
}
/* Stile box rosso mediatori */
.card-rosso {
    background: linear-gradient(135deg, rgba(85, 16, 16, 0.92), rgba(122, 43, 43, 0.92)) !important;
    color: #fff !important;
    border: 2px solid #fff !important;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    padding: 28px 24px;
}
.card-rosso h3, .card-rosso p {
    color: #fff !important;
}
@media (max-width: 900px) {
    .mediatori-grid {
        grid-template-columns: 1fr !important;
        gap: 24px;
    }
    .mediatori-grid .card,
    .mediatori-grid .card-rosso {
        width: 100%;
        margin-bottom: 0;
        padding: 20px 16px;
        box-sizing: border-box;
    }
}
/* Download list con icone Word/PDF */
.download-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 0;
}
.download-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    justify-content: space-between;
}
.download-icons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}
.download-label {
    font-weight: 600;
    color: var(--color-primary);
    margin-right: 6px;
}
.icon-link {
    display: inline-flex;
    align-items: center;
    margin-right: 2px;
    transition: transform 0.15s;
}
.icon-link:hover {
    transform: scale(1.12);
}
.formazione-cta .cta-content hr {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}
.formazione-cta .cta-actions {
    width: 100%;
    display: flex;
    justify-content: center;
}
.formazione-cta .cta-content {
    padding-left: 0;
    padding-right: 0;
}
.formazione-cta .cta-actions {
    justify-content: center !important;
    width: 100%;
}
/* Fix: hr e pulsante centrato nella formazione-cta */
.formazione-cta hr {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}
.formazione-cta .cta-actions {
    justify-content: center;
    width: 100%;
}
/* Formazione sezione: lista + pulsante orizzontali */
.formazione-row {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    margin-top: 0;
}
/* Stile per il testo "prossimi corsi in programma" come "invia una mail a" */
.prossimi-corsi {
    color: var(--color-text);
    font-weight: bold;
    font-size: 1.4em;
    margin-bottom: 8px;
    margin-top: 0;
}
.prossimi-corsi strong {
    color: var(--color-primary);
    font-size: 1em;
    font-weight: bold;
}
.formazione-row .workflow-steps {
    flex: 2 1 0;
    margin-bottom: 0;
}
.formazione-row .cta-actions {
    flex: 1 1 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    margin-top: 46px;
}
@media (max-width: 900px) {
    .formazione-row {
        flex-direction: column;
        gap: 24px;
    }
    .formazione-row .cta-actions {
        justify-content: flex-start;
        margin-top: 0;
    }
}
:root {
    --color-primary: #551010;
    --color-secondary: #7a2b2b;
    --color-contrast: #f4ede6;
    --color-surface: #ffffff;
    --color-text: #3c2323;
    --color-muted: #735858;
    --color-pdf: #c41e3a;
    --color-word: #0078d4;
    --color-indennita: #541313;
    --color-modulistica: #10826c;
    --shadow-soft: 0 12px 30px rgba(85, 16, 16, 0.08);
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --transition-base: 0.25s ease;
}

/* Prevent layout shift in Chrome when scrollbar appears/disappears */
html {
    scrollbar-gutter: stable;
    /* Reserve vertical scrollbar area so pages without overflow don't shift layout */
    overflow-y: scroll;
    background: linear-gradient(180deg, #551010 0%, rgba(122, 43, 43, 0.92) 15%, rgba(168, 110, 98, 0.26) 45%, rgba(248, 238, 233, 0.14) 60%, #f8f5e8 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Use border-box everywhere for consistent sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Verdana", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: #faf7f4;
    overflow-x: hidden;
}

header img {
    display: block;
    margin: 0 auto;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 911px) {
    .container {
        padding: 0 24px;
    }
}

.site-header {
    background: linear-gradient(135deg, rgba(85, 16, 16, 0.92), rgba(122, 43, 43, 0.92));
    color: #fff;
    position: relative;
}

/* Header sfondo solido per pagine interne (non homepage) */
body:not(.home) .site-header {
    background: linear-gradient(180deg, #551010 0%, rgba(122, 43, 43, 0.92) 100%);
}

.site-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.site-brand {
    font-size: 20px;
    letter-spacing: 1.2px;
    font-weight: bold;
    text-transform: uppercase;
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-brand-logo {
    height: 40px;
    width: auto;
    flex: 0 1 auto;
    margin-left: 24px;
}

@media (min-width: 911px) {
    .site-header-inner {
        padding: 28px 24px;
        gap: 32px;
    }

    .site-brand {
        font-size: 24px;
        letter-spacing: 1.6px;
    }

    .site-brand-logo {
        height: 56px;
        margin-left: 16px;
    }
}

/* Header responsive styles for navigation */
.site-nav a {
    font-size: 14px;
}
.site-brand-logo {
    margin-left: -8px;
}
@media (max-width: 910px) {
    .site-nav a {
        font-size: 10px;
    }
}
@media (min-width: 911px) and (max-width: 1032px) {
    .site-nav a {
        font-size: 11px !important;
    }
    .site-nav ul {
        gap: 4px;
    }
    .site-brand-logo {
        height: 60px;
    }
}
@media (min-width: 1033px) {
    .site-nav ul {
        gap: 4px;
    }
    .site-brand-logo {
        height: 70px;
    }
}

/* Hamburger menu button - shown on mobile, hidden on desktop */
.menu-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 0;
    padding: 8px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    margin-left: auto;
}

.menu-toggle .bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #ffece6;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-toggle .bar {
    display: none;
}

.menu-toggle .menu-label {
    display: inline-block;
    color: #ffece6;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.menu-toggle.open .menu-label {
    content: '';
}

/* Navigation - Mobile: hidden offscreen, Desktop: visible horizontal */
.site-nav {
    display: none;
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav a {
    color: #ffece6;
    text-decoration: none;
    transition: color var(--transition-base);
}

.site-nav a:hover {
    text-decoration: underline;
}

@media (min-width: 911px) {
    .menu-toggle {
        display: none;
    }

    .site-nav {
        display: block;
        position: static;
        height: auto;
        width: auto;
        background: none;
        padding: 0;
        box-shadow: none;
    }

    .site-nav ul {
        display: flex;
        gap: 4px;
    }

    .site-nav a {
        font-size: 14px;
        letter-spacing: 0.6px;
        text-transform: uppercase;
        font-weight: 600;
        padding: 6px 10px;
        border-radius: var(--radius-sm);
    }

    .site-nav a:hover {
        background: rgba(255, 255, 255, 0.15);
        color: #ffffff;
    }
}

@media (max-width: 910px) {
    .site-brand-logo {
        margin-left: -9px;
    }

    .site-nav {
        display: block;
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 0;
        overflow: hidden;
        background: linear-gradient(180deg, rgba(85,16,16,0.98), rgba(122,43,43,0.98));
        color: #fff;
        padding-top: 72px;
        box-shadow: -8px 0 30px rgba(0,0,0,0.25);
        transition: width 0.28s ease;
        z-index: 1200;
    }

    .site-nav.open {
        width: 260px;
    }

    .site-nav ul {
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 8px 12px;
    }

    .site-nav li {
        list-style: none;
    }

    .site-nav a {
        color: #fff;
        display: block;
        padding: 12px 10px;
        font-size: 16px;
        border-radius: 6px;
    }

    .site-nav a:hover {
        background: rgba(255,255,255,0.06);
    }

    body.menu-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.35);
        z-index: 1100;
    }

    body.menu-open {
        overflow: hidden;
    }
}

/* Layout legacy pages */
nav table {
    width: 100%;
    border-collapse: collapse;
}

nav td {
    text-align: center;
    background-image: url("mattoncino.jpg");
    padding: 5px;
}

nav td a {
    color: #550000;
    font-family: Verdana, sans-serif;
    font-size: 10px;
    text-decoration: none;
}

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 16px 60px;
}

.home main {
    padding-top: 0;
    padding-bottom: 80px;
}

@media (min-width: 911px) {
    main {
        padding: 60px 24px 80px;
    }

    .home main {
        padding-top: 40px;
        padding-bottom: 100px;
    }
}

.home .hero {
    background: linear-gradient(135deg, rgba(245, 220, 210, 0.95), rgba(250, 230, 220, 0.85));
    border-radius: var(--radius-lg);
    padding: 12px 24px 24px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
}

.home .hero .container {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: flex-start;
    justify-content: flex-start;
}

.home .hero-text {
    flex: 1;
    width: 100%;
}

.home .hero-text h1 {
    font-size: 24px;
    line-height: 1.3;
    margin: 0 0 8px;
    color: var(--color-primary);
}

.home .hero-text p {
    color: var(--color-muted);
    margin-bottom: 20px;
    font-size: 14px;
}

@media (min-width: 911px) {
    .home .hero {
        padding: 60px 48px;
        margin-bottom: 64px;
    }

    .home .hero .container {
        flex-direction: row;
        gap: 48px;
        align-items: flex-start;
        justify-content: space-between;
    }

    .home .hero-text {
        flex: 1 1 55%;
    }

    .home .hero-text h1 {
        font-size: 28px;
    }
}

.hero-image {
    max-width: 100%;
    height: auto;
    margin: 0;
    border-radius: var(--radius-md);
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
}

@media (min-width: 911px) {
    .hero-actions {
        flex-direction: row;
        width: 100%;
        gap: 16px;
        justify-content: center;
    }
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: transform var(--transition-base), box-shadow var(--transition-base), background var(--transition-base), color var(--transition-base);
    width: 100%;
    text-align: center;
}

@media (min-width: 911px) {
    .button {
        width: auto;
        padding: 10px 18px;
    }
}

.button.primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 10px 20px rgba(85, 16, 16, 0.2);
}

.button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(85, 16, 16, 0.28);
}

/* Alternate button used on the homepage CTA: white background with
   dark red text (site primary color). Keeps accessible contrast. */
.button.alt-white {
    background: #ffffff;
    color: var(--color-primary);
    border: 1px solid rgba(85,16,16,0.08);
    box-shadow: none;
}
.button.alt-white:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(85, 16, 16, 0.08);
}

.section-title {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-secondary);
    margin-bottom: 12px;
    padding: 0 16px;
}

@media (min-width: 911px) {
    .section-title {
        padding: 0;
    }
}

.services .container {
    padding-left: 0;
    padding-right: 0;
}

@media (min-width: 911px) {
    .services .container {
        padding-left: 24px;
        padding-right: 24px;
    }
}

.home .services {
    margin-bottom: 40px;
}

@media (min-width: 911px) {
    .home .services {
        margin-bottom: 60px;
    }
}

.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 911px) {
    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 24px;
    }
}

.card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 28px 16px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(85, 16, 16, 0.08);
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
}

@media (min-width: 911px) {
    .card {
        padding: 28px 24px;
        margin-bottom: 0;
    }
}

.card h3 {
    margin: 0;
    font-size: 18px;
    color: var(--color-primary);
}

.card p {
    margin: 0;
    color: var(--color-muted);
    line-height: 1.6;
}

.text-link {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.workflow {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 32px 20px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 40px;
}

@media (min-width: 911px) {
    .workflow {
        padding: 48px 40px;
        margin-bottom: 60px;
    }
}

.workflow-container .workflow-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}

@media (min-width: 911px) {
    .workflow-container .workflow-grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }
}

.workflow-left .download-box {
    background: transparent;
    padding: 0;
}

/* Make sure both section titles visually match */
.workflow .section-title {
    margin-top: 0;
}

.workflow-steps {
    margin: 24px 0 0;
    padding-left: 20px;
    color: var(--color-muted);
    display: grid;
    gap: 16px;
}

.workflow-steps li {
    padding-left: 6px;
}

.workflow-steps strong {
    color: var(--color-primary);
}

.values {
    margin-bottom: 40px;
}

@media (min-width: 911px) {
    .values {
        margin-bottom: 60px;
    }
}

.values-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}

@media (min-width: 911px) {
    .values-grid {
        grid-template-columns: 1.1fr 0.9fr;
        gap: 32px;
        align-items: center;
    }
}

.values-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 16px;
    color: var(--color-muted);
}

.values-list li {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(85, 16, 16, 0.08);
}

.values-list strong {
    display: block;
    margin-bottom: 6px;
    color: var(--color-primary);
}

.cta-banner {
    background: linear-gradient(135deg, rgba(85, 16, 16, 0.95), rgba(122, 43, 43, 0.9));
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 36px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    box-shadow: var(--shadow-soft);
}

@media (min-width: 911px) {
    .cta-banner {
        padding: 48px 40px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 32px;
    }
}

/* Specific spacing for the formazione CTA section */
.formazione-cta {
    margin-top: 40px; /* base spacing on mobile */
}

@media (min-width: 911px) {
    .formazione-cta {
        margin-top: 64px; /* increased spacing on tablet and up */
    }
}

.cta-content h2 {
    margin: 0 0 12px;
    font-size: 22px;
    line-height: 1.4;
}

.cta-content p {
    margin: 0;
    color: #fbe7df;
}

.cta-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
}

@media (min-width: 911px) {
    .cta-actions {
        flex-direction: row;
        width: auto;
        gap: 14px;
    }
}

/* Make the formazione CTA use the same color / text styling as the
   "Come si avvia una mediazione" card: light surface background,
   muted body text and primary accents for strong text. Keep the
   rectangular appearance but adopt card colors. */
.formazione-cta {
    background: var(--color-surface);
    color: var(--color-text);
    border-radius: var(--radius-md);
    padding: 28px 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(85, 16, 16, 0.08);
}

.formazione-cta .cta-content .section-title {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-secondary);
    margin-bottom: 12px;
}

.formazione-cta .workflow-steps {
    margin: 24px 0 0;
    padding-left: 20px;
    color: var(--color-muted);
    display: grid;
    gap: 16px;
}

.formazione-cta .workflow-steps li { padding-left: 6px; }

.formazione-cta .workflow-steps strong {
    color: var(--color-primary);
}

.formazione-cta .cta-actions .button.primary {
    background: var(--color-primary);
    color: #fff;
}

/* Legacy sections reuse */
main ul {
    list-style-type: none;
    padding-left: 0;
}

table {
    border-collapse: collapse;
    width: 100%;
    margin: 16px 0;
}

table td,
table th {
    font-family: Verdana, sans-serif;
    font-size: 12px;
    padding: 8px;
    border: 1px solid rgba(85, 16, 16, 0.1);
    text-align: left;
}

table th {
    background: rgba(85, 16, 16, 0.05);
    font-weight: 600;
    color: var(--color-primary);
}

/* Download table - responsive stacking on mobile */
.download-table {
    font-size: 13px;
}

.download-table thead {
    display: none;
}

@media (min-width: 911px) {
    .download-table thead {
        display: table-header-group;
    }
}

.download-table tbody tr {
    display: grid;
    grid-template-columns: 1fr;
    margin-bottom: 20px;
    border: 1px solid rgba(85, 16, 16, 0.1);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

@media (min-width: 911px) {
    .download-table tbody tr {
        display: table-row;
        margin-bottom: 0;
        border: none;
        border-bottom: 1px solid rgba(85, 16, 16, 0.1);
    }
}

.download-table td {
    display: flex;
    flex-direction: column;
    padding: 12px;
}

.download-table td::before {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 6px;
    font-size: 11px;
    text-transform: uppercase;
}

.download-table td:nth-child(1)::before {
    content: "Mediapolis";
}

.download-table td:nth-child(2)::before {
    content: "Mediazione";
}

.download-table td:nth-child(3)::before {
    content: "Formazione";
}

@media (min-width: 911px) {
    .download-table td::before {
        display: none;
    }

    .download-table td {
        display: table-cell;
        flex-direction: row;
        padding: 8px;
    }
}

/* Mediatori table - responsive layout */
.mediatori-table {
    font-size: 13px;
}

.mediatori-table thead {
    display: none;
}

.mediatori-table tbody tr {
    display: grid;
    grid-template-columns: 1fr;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--color-surface);
    border: 1px solid rgba(85, 16, 16, 0.08);
    border-radius: var(--radius-md);
}

@media (min-width: 911px) {
    .mediatori-table tbody tr {
        display: table-row;
        margin-bottom: 0;
        padding: 0;
        background: transparent;
        border: none;
        border-bottom: 1px solid rgba(85, 16, 16, 0.1);
        border-radius: 0;
    }
}

.mediatori-table td {
    display: flex;
    flex-direction: column;
    padding: 0;
    margin-bottom: 8px;
}

.mediatori-table td:last-child {
    margin-bottom: 0;
}

.mediatori-table td::before {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 4px;
    font-size: 11px;
    text-transform: uppercase;
}

.mediatori-table td:nth-child(1)::before {
    content: "Nome";
}

.mediatori-table td:nth-child(2)::before {
    content: "Qualifica";
}

@media (min-width: 911px) {
    .mediatori-table td::before {
        display: none;
    }

    .mediatori-table td {
        display: table-cell;
        flex-direction: row;
        padding: 8px;
        margin-bottom: 0;
    }
}

footer {
    max-width: 1100px;
    margin: 40px auto 60px;
    text-align: center;
    font-size: 11px;
    color: var(--color-muted);
    padding: 0 16px;
}

footer a {
    color: var(--color-muted);
}

.footer-right a {
    text-decoration: none;
}

.footer-right a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: left;
}

@media (min-width: 911px) {
    footer {
        padding: 0 24px;
    }

    .footer-content {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 20px;
    }
}

.footer-left, .footer-center, .footer-right {
    flex: 1;
}

.footer-center h3, .footer-left h3, .footer-right h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.footer-center p svg {
    vertical-align: middle;
    margin-right: 8px;
}

.whatsapp-float {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-soft);
    z-index: 999;
    transition: transform var(--transition-base), background var(--transition-base);
}

.whatsapp-float:hover {
    background: var(--color-secondary);
    transform: translateY(-2px);
    text-decoration: none;
}

@media (max-width: 800px) {
    .whatsapp-float {
        right: 14px;
        bottom: 14px;
        width: 48px;
        height: 48px;
    }
}

hr {
    border: 0;
    height: 1px;
    background-color: rgba(85, 16, 16, 0.2);
    margin: 32px 0;
}

form input[type="text"],
form input[type="email"],
form textarea {
    border: 1px solid rgba(85, 16, 16, 0.15);
    border-radius: 4px;
    padding: 10px 12px;
    font-family: "Verdana", sans-serif;
    font-size: 13px;
    max-width: 100%;
    width: 100%;
    background-color: #fafafa;
    color: var(--color-text);
    transition: border-color var(--transition-base), background-color var(--transition-base);
}

form input[type="text"]:focus,
form input[type="email"]:focus,
form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: #ffffff;
}

form textarea {
    resize: vertical;
    min-height: 120px;
}

form input[type="submit"] {
    background-color: var(--color-primary);
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    cursor: pointer;
    font-family: "Verdana", sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 4px;
    transition: background var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
    box-shadow: 0 2px 8px rgba(85, 16, 16, 0.12);
}

form input[type="submit"]:hover {
    background-color: var(--color-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(85, 16, 16, 0.2);
}

form input[type="submit"]:active {
    transform: translateY(0);
}

/* Download buttons for PDF and Word */
.btn-download {
    display: inline-block;
    color: #ffffff;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    font-family: "Verdana", sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    border-radius: 3px;
    transition: background var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    margin-left: 4px;
    width: 50px;
    text-align: center;
    flex-shrink: 0;
}

.btn-download:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-download:active {
    transform: translateY(0);
}

.btn-pdf {
    background-color: var(--color-pdf);
}

.btn-pdf:hover {
    background-color: #a01729;
}

.btn-word {
    background-color: var(--color-word);
}

.btn-word:hover {
    background-color: #0063b1;
}

.btn-orange {
    background-color: #d97706;
    white-space: nowrap;
    width: auto;
    padding: 4px 12px;
}

.btn-orange:hover {
    background-color: #b45309;
}

.btn-indennita,
.btn-modulistica {
    width: auto;
    padding: 4px 12px;
    white-space: nowrap;
    color: #ffffff;
}

.download-icons-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.download-icons-actions .btn-download {
    margin-left: 0;
}

@media (max-width: 800px) {
    .download-icons-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }

    .download-item {
        align-items: flex-start;
    }

    .download-label {
        flex: 1;
        min-width: 0;
    }
}

.btn-indennita {
    background-color: var(--color-indennita);
}

.btn-modulistica {
    background-color: var(--color-modulistica);
}

@media (min-width: 911px) and (max-width: 1080px) {
    .btn-indennita,
    .btn-modulistica {
        padding: 4px 8px;
        font-size: 9px;
        letter-spacing: 0.2px;
    }
}

/* Mobile-first form table styling */
form table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

form table tr {
    display: flex;
    flex-direction: column;
    border: none;
    margin-bottom: 16px;
    padding: 0;
}

form table tr:last-child {
    margin-bottom: 0;
}

form table td {
    padding: 0;
    text-align: left;
    border: none;
}

form table td:first-child {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 12px;
    margin-bottom: 6px;
}

form table td:last-child input,
form table td:last-child textarea {
    margin-bottom: 0;
}

form table td[colspan="2"] {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 12px;
    margin: 12px 0 6px 0;
}

form table td[colspan="2"] input[type="submit"] {
    width: auto;
    margin-top: 8px;
}

@media (min-width: 911px) {
    form table tr {
        display: table-row;
        border: none;
        margin-bottom: 0;
        padding: 0;
    }

    form table td {
        padding: 12px 8px;
        text-align: left;
        border: none;
    }

    form table td:first-child {
        font-weight: 600;
        width: auto;
        background: transparent;
        padding-right: 16px;
        white-space: nowrap;
    }

    form table td[colspan="2"] {
        padding-top: 20px;
    }

    form table td[colspan="2"] input[type="submit"] {
        float: right;
    }
}

#spazionvuoto,
#spazio {
    width: 25px;
}

#table1,
#table4 {
    border-collapse: collapse;
}

@media (min-width: 911px) and (max-width: 900px) {
    /* Intermediate breakpoint to prevent overflow between 768px and 900px */
    main {
        padding: 40px 16px 60px;
    }

    .container {
        padding: 0 16px;
    }

    .home .hero {
        padding: 40px 16px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .split-workflow {
        flex-direction: column;
    }

    .download-panel {
        flex: 1 1 auto;
        max-width: 100%;
    }
}

/* Split workflow: two independent panels side-by-side */
.split-workflow {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
    margin: 32px 0 40px;
}

.split-workflow .workflow-panel {
    /* warm off-white to contrast with page background */
    background: #fffaf2;
    border-radius: var(--radius-md);
    padding: 28px;
    width: 100%;
    /* stronger, warmer shadow so panels look detached */
    box-shadow: 0 26px 60px rgba(85,16,16,0.06);
    border: 1px solid rgba(85,16,16,0.08);
}

@media (min-width: 911px) {
    .split-workflow {
        flex-direction: row;
        gap: 28px;
    }

    .split-workflow .workflow-panel {
        margin-bottom: 0;
    }
}

/* Right panel fixed width (desktop) */
.download-panel {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
}

@media (min-width: 911px) {
    .download-panel {
        flex: 0 0 380px;
        max-width: 380px;
    }
}

/* Left panel grows to use remaining space */
.instructions-panel {
    flex: 1 1 0;
    width: 100%;
}

@media (max-width: 600px) {
    body {
        font-size: 13px;
    }

    .home .hero {
        padding: 32px 16px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Cookie Banner */
#cookie-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: linear-gradient(135deg, rgba(85, 16, 16, 0.98) 0%, rgba(122, 43, 43, 0.95) 100%);
    color: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

#cookie-banner.cookie-banner-hidden {
    animation: slideOut 0.3s ease-out;
    transform: translateX(120%);
    opacity: 0;
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

.cookie-banner-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cookie-banner-text {
    width: 100%;
}

.cookie-banner-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #fff;
}

.cookie-banner-text a {
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
}

.cookie-banner-text a:hover {
    text-decoration: none;
}

.cookie-banner-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.cookie-btn {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #fff;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cookie-accept,
.cookie-reject {
    background: #fff;
    color: var(--color-primary);
}

.cookie-accept:hover,
.cookie-reject:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@media (max-width: 480px) {
    #cookie-banner {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        padding: 20px;
    }
    
    .cookie-banner-text p {
        font-size: 13px;
    }
    
    .cookie-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
}

