* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Select Styling - Coerente con form-input */
select.form-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23003d7a' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M5 7l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 18px;
    padding-right: 35px;
    cursor: pointer;
}

/* Hover */
select.form-input:hover {
    border-color: #003d7a;
}

/* Focus */
select.form-input:focus {
    outline: none;
    border-color: #003d7a;
    box-shadow: 0 0 0 3px rgba(0, 61, 122, 0.1);
}


/*HERO SECTION - OTTIMIZZATO*/

.hero {
    background:
        linear-gradient(135deg, rgba(0, 40, 80, 0.50) 0%, rgba(30, 70, 120, 0.45) 100%),
        url(../file/digcompedu.webp) center / cover no-repeat fixed;
    background-color: #1a3a5a;
    padding: 60px 20px;
    text-align: center;
    position: relative;
    min-height: 540px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .hero {
        background-attachment: scroll;
    }
}

@media (max-width: 768px) {
    .hero {
        background-attachment: scroll;
        min-height: 400px;
    }
}


/* Overlay aggiuntivo per aumentare il contrasto */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center,
            rgba(0, 0, 0, 0.3) 0%,
            rgba(0, 0, 0, 0.5) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Contenitore testo con z-index maggiore */
.hero h1,
.hero p,
.hero>* {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 800;
    color: #ffffff;
    text-shadow:
        3px 3px 6px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(0, 102, 204, 0.3);
    margin-bottom: 15px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.hero p,
.hero .subtitle {
    font-size: clamp(1rem, 3vw, 1.4rem);
    color: #ffffff;
    text-shadow:
        2px 2px 4px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(0, 0, 0, 0.3);
    margin-bottom: 25px;
    font-style: italic;
    font-weight: 300;
    letter-spacing: 0.3px;
}



/* Logo box con glass morphism */
.hero .logo-box,
.hero .logo-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 30px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.hero .logo-box img,
.hero .logo-wrapper img {
    max-height: 90px;
    width: auto;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        padding: 40px 15px;
        min-height: 400px;
    }

    .hero h1 {
        text-shadow:
            2px 2px 4px rgba(0, 0, 0, 0.5),
            0 0 10px rgba(0, 102, 204, 0.2);
    }

    .hero p,
    .hero .subtitle {
        text-shadow:
            1px 1px 3px rgba(0, 0, 0, 0.5);
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 30px 10px;
        min-height: 350px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p,
    .hero .subtitle {
        font-size: 1rem;
    }
}


/* Main Container */
.container {
    max-width: 1782px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Two Column Layout */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 120px;
    align-items: start;
}

/* Form Section */
.form-section {
    border: 2px solid #003d7a;
    border-radius: 8px;
    padding: 30px;
    background-color: #f9f9f9;
}

.form-section h2 {
    font-size: 24px;
    color: #003d7a;
    margin-bottom: 25px;
    text-align: center;
}

/* Section Title */
.section-title {
    color: #c41e3a;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #c41e3a;
}

/* Form Grid - Layout a 2 colonne */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

/* Campo che occupa tutta la larghezza */
.form-group-full {
    grid-column: 1 / -1;
}

/* Form Divider - HR stilizzato */
.form-divider {
    border: none;
    height: 2px;
    background: linear-gradient(to right, #003d7a 0%, #005a9c 50%, #003d7a 100%);
    margin: 30px 0;
    opacity: 0.6;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .section-title {
        font-size: 16px;
    }

    .form-divider {
        margin: 20px 0;
    }
}


/* Accordion Section */
.accordion-section {
    width: 100%;
}

.accordion {
    border-top: 2px solid #003d7a;
}

.accordion-header {
    display: grid;
    grid-template-columns: 30px 1fr 30px;
    gap: 15px;
    align-items: center;
    padding: 20px 0;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    transition: background-color 0.s ease;
}

.accordion-header:hover {
    background-color: rgba(0, 61, 122, 0.03);
}

.accordion-header:focus {
    outline: 2px solid #003d7a;
    outline-offset: -2px;
}

.accordion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #003d7a;
    font-weight: bold;
    font-size: 18px;
    transition: transform 0.3s ease;
}

.accordion-title {
    color: #c41e3a;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}


/* Accordion Body - Versione migliorata per mobile */
.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 0 0 45px;
}

.accordion-body.active {
    max-height: 800px;
    /* o usa il valore dinamico con JavaScript */
    overflow: hidden;
    /* Cambiato da overflow-y: auto */
    padding: 0 0 20px 45px;
    -webkit-overflow-scrolling: touch;
}


/* Stili per gli elementi HTML nell'accordion */
.accordion-body h4 {
    color: #003d7a;
    font-size: 16px;
    font-weight: 600;
    margin: 15px 0 10px 0;
}

.accordion-body h5 {
    color: #005a9c;
    font-size: 14px;
    font-weight: 600;
    margin: 12px 0 8px 0;
}

.accordion-body p {
    margin: 0 0 15px 0;
    color: #555;
    font-size: 14px;
    line-height: 1.8;
}

.accordion-body ul {
    margin: 15px 0 15px 0;
    padding-left: 20px;
    list-style-type: disc;
}

.accordion-body li {
    margin-bottom: 10px;
    color: #555;
    font-size: 14px;
    line-height: 1.8;
}

.accordion-body a {
    color: #003d7a;
    word-break: break-word;
}

.accordion-body strong {
    color: #003d7a;
    font-weight: 600;
}

.accordion-body em {
    font-style: italic;
    color: #666;
}

/* Responsive - Tablet e Mobile */
@media (max-width: 768px) {
    .content-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero .subtitle {
        font-size: 22px;
    }

    .hero .tagline {
        font-size: 16px;
    }

    /* Container e form ottimizzati per mobile */
    .container {
        padding: 20px 15px;
    }

    .form-section {
        padding: 20px;
    }

    /* Accordion ottimizzato per mobile */
    .accordion-header {
        padding: 15px 0;
    }

    .accordion-title {
        font-size: 14px;
    }

    .accordion-body {
        padding: 0 0 0 15px;
    }

    .accordion-body.active {
        padding: 0 0 20px 15px;
        max-height: 80vh;
        overflow-y: auto;
    }

    .accordion-body h4 {
        font-size: 15px;
    }

    .accordion-body h5 {
        font-size: 13px;
    }

    .accordion-body p,
    .accordion-body li {
        font-size: 13px;
        line-height: 1.7;
    }
}

/* Per schermi molto piccoli */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 26px;
    }

    .hero .tagline {
        font-size: 14px;
    }

    .accordion-body.active {
        max-height: 70vh;
    }

    .accordion-body h4 {
        font-size: 14px;
    }

    .accordion-body h5 {
        font-size: 12px;
    }

    .accordion-body p,
    .accordion-body li {
        font-size: 12px;
    }
}

/* Intro Paragraph - Prima dell'accordion */
.intro-paragraph {
    text-align: justify;
    line-height: 1.8;
    color: #555;
    font-size: 14px;
    margin-bottom: 20px;
    padding: 0px 80px;
}

/* Tablet */
@media (max-width: 768px) {
    .intro-paragraph {
        padding: 0px 20px;
        font-size: 13px;
        line-height: 1.7;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .intro-paragraph {
        padding: 0px 10px;
        font-size: 12px;
    }
}

.intro-paragraph a {
    color: #003d7a;
    font-weight: 600;
    transition: color 0.2s ease;
}

.intro-paragraph a:hover {
    color: #005a9c;
    text-decoration: none;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .intro-paragraph {
        font-size: 13px;
        line-height: 1.7;
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    .intro-paragraph {
        font-size: 12px;
    }
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

/* Checkbox styling */
.checkbox-group {
    margin: 25px 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    gap: 10px;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #003d7a;
}

.checkbox-text {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

.checkbox-label:hover .checkbox-text {
    color: #003d7a;
}

/* Submit button styling */
.submit-group {
    text-align: center;
    margin-top: 30px;
}

.submit-btn {
    background-color: #003d7a;
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 5px rgba(0, 61, 122, 0.2);
}

.submit-btn:hover {
    background-color: #005a9c;
    box-shadow: 0 4px 8px rgba(0, 61, 122, 0.3);
    transform: translateY(-2px);
}

.submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 61, 122, 0.2);
}

.submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

/* Responsive mobile */
@media (max-width: 768px) {
    .checkbox-label input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }

    .checkbox-text {
        font-size: 13px;
    }

    .submit-btn {
        width: 100%;
        padding: 12px 30px;
        font-size: 15px;
    }
}

/* Privacy Section - Sostituisce l'accordion */
.privacy-section {
    width: 100%;
    border: 1px solid #003d7a;
    border-radius: 8px;
    padding: 25px;
    background-color: #f9f9f9;
    max-height: 235px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.privacy-title {
    color: #003d7a;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #003d7a;
}

.privacy-content h4 {
    color: #003d7a;
    font-size: 16px;
    font-weight: 600;
    margin: 15px 0 10px 0;
}

.privacy-content h5 {
    color: #005a9c;
    font-size: 14px;
    font-weight: 600;
    margin: 12px 0 8px 0;
}

.privacy-content p {
    margin: 0 0 15px 0;
    color: #555;
    font-size: 14px;
    line-height: 1.8;
}

.privacy-content ul {
    margin: 15px 0 15px 0;
    padding-left: 20px;
    list-style-type: disc;
}

.privacy-content li {
    margin-bottom: 10px;
    color: #555;
    font-size: 14px;
    line-height: 1.8;
}

.privacy-content a {
    color: #003d7a;
    text-decoration: underline;
    word-break: break-word;
}

.privacy-content strong {
    color: #003d7a;
    font-weight: 600;
}

.privacy-content em {
    font-style: italic;
    color: #666;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .privacy-section {
        padding: 20px;
        max-height: 500px;
    }

    .privacy-title {
        font-size: 18px;
    }

    .privacy-content h4 {
        font-size: 15px;
    }

    .privacy-content h5 {
        font-size: 13px;
    }

    .privacy-content p,
    .privacy-content li {
        font-size: 13px;
        line-height: 1.7;
    }
}

@media (max-width: 480px) {
    .privacy-section {
        max-height: 400px;
    }

    .privacy-content h4 {
        font-size: 14px;
    }

    .privacy-content h5 {
        font-size: 12px;
    }

    .privacy-content p,
    .privacy-content li {
        font-size: 12px;
    }
}

/* Form Fields Section */
.form-fields {
    width: 100%;
}

/* Form Group - Wrapper per ogni campo */
.form-group {
    margin-bottom: 20px;
}

/* Form Label */
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

/* Form Input */
.form-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #003d7a;
    box-shadow: 0 0 0 3px rgba(0, 61, 122, 0.1);
}


/* Placeholder styling */
.form-input::placeholder {
    color: #999;
    font-style: italic;
}

/* Disabled state */
.form-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 16px;
    }

    .form-label {
        font-size: 13px;
    }

    .form-input {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* Checkbox Group - Aggiornato */
.checkbox-group {
    margin: 25px 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    gap: 12px;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #003d7a;
}

.checkbox-content {
    flex: 1;
}

.checkbox-text {
    display: block;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    font-weight: 500;
    margin-bottom: 10px;
}

.checkbox-list {
    margin: 10px 0 0 0;
    padding-left: 20px;
    list-style-type: disc;
}

.checkbox-list li {
    margin-bottom: 8px;
    color: #555;
    font-size: 13px;
    line-height: 1.6;
}

.checkbox-list li a {
    color: #003d7a;
    text-decoration: none;
    transition: color 0.2s ease;
}

.checkbox-list li a:hover {
    color: #005a9c;
    text-decoration: underline;
}

.checkbox-list li a:visited {
    color: #4a5568;
}

.checkbox-label:hover .checkbox-text {
    color: #003d7a;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .checkbox-label {
        gap: 10px;
    }

    .checkbox-label input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    .checkbox-text {
        font-size: 13px;
    }

    .checkbox-list {
        padding-left: 18px;
    }

    .checkbox-list li {
        font-size: 12px;
        margin-bottom: 6px;
    }
}

@media (max-width: 480px) {
    .checkbox-label input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }

    .checkbox-text {
        font-size: 12px;
    }

    .checkbox-list li {
        font-size: 11px;
    }
}

/* File Input Styling */
.form-input-file {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    border: 2px dashed #003d7a;
    border-radius: 4px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-input-file:hover {
    background-color: #e9ecef;
    border-color: #005a9c;
}

.form-input-file:focus {
    outline: none;
    border-color: #003d7a;
    border-style: solid;
    box-shadow: 0 0 0 3px rgba(0, 61, 122, 0.1);
}

/* Styling del pulsante file nativo */
.form-input-file::file-selector-button {
    padding: 8px 16px;
    margin-right: 12px;
    background-color: #003d7a;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: background-color 0.3s ease;
}

.form-input-file::file-selector-button:hover {
    background-color: #005a9c;
}

/* File Helper Text */
.file-helper {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* File input con file selezionato */
.form-input-file:valid {
    border-color: #28a745;
    border-style: solid;
    background-color: #f0fff4;
}

/* File input required */
.form-input-file:required {
    border-left: 3px solid #003d7a;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .form-input-file {
        padding: 8px;
        font-size: 13px;
    }

    .form-input-file::file-selector-button {
        padding: 6px 12px;
        margin-right: 8px;
        font-size: 12px;
    }

    .file-helper {
        font-size: 11px;
        margin-top: 4px;
    }
}

@media (max-width: 480px) {
    .form-input-file::file-selector-button {
        display: block;
        width: 100%;
        margin-right: 0;
        margin-bottom: 8px;
    }
}

/* Alert Messages */
.alert {
    padding: 16px 20px;
    margin: 0 auto 25px auto;
    max-width: 800px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
    border-left: 4px solid;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    animation: slideInDown 0.4s ease-out;
    text-align: center;
}

/* Alert Success */
.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.alert-success::before {
    content: "✓ ";
    font-weight: 700;
    font-size: 18px;
    margin-right: 8px;
}

/* Alert Error/Danger */
.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left-color: #c41e3a;
}

.alert-danger::before {
    content: "⚠ ";
    font-weight: 700;
    font-size: 18px;
    margin-right: 8px;
}

/* Alert Info (opzionale) */
.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left-color: #17a2b8;
}

.alert-info::before {
    content: "ℹ ";
    font-weight: 700;
    font-size: 18px;
    margin-right: 8px;
}

/* Animation */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Alert hover effect */
.alert:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .alert {
        padding: 14px 16px;
        font-size: 14px;
        margin-bottom: 20px;
        max-width: 95%;
    }

    .alert::before {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .alert {
        padding: 12px 14px;
        font-size: 13px;
        border-radius: 4px;
        max-width: 100%;
    }
}

/* Terms Notice */
.terms-notice {
    text-align: center;
    margin-top: 20px;
    padding: 0 20px;
}

.terms-notice p {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.terms-notice a {
    color: #003d7a;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease;
}

.terms-notice a:hover {
    color: #005a9c;
    text-decoration: none;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .terms-notice {
        margin-top: 16px;
        padding: 0 10px;
    }

    .terms-notice p {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .terms-notice p {
        font-size: 11px;
    }
}

.gtc-card {
    display: block;
    max-width: 420px;
    text-decoration: none;
    color: inherit;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
    transition: transform .25s ease, box-shadow .25s ease;
}

.gtc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .12);
}

.gtc-card-content {
    padding: 24px;
}

.gtc-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #0f4c81;
    background: #e6f0fa;
    padding: 6px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.gtc-card h3 {
    font-size: 20px;
    margin: 0 0 10px;
}

.gtc-card p {
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    margin-bottom: 20px;
}

.gtc-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #cc151c;
}

.gtc-cta span {
    transition: transform .2s ease;
}

.gtc-card:hover .gtc-cta span {
    transform: translateX(4px);
}

.gtc-card,
.gtc-card:visited,
.gtc-card:hover,
.gtc-card:active,
.gtc-card:focus {
    text-decoration: none;
    color: inherit;
}

/* Contenitore firma allineato alla colonna del form */
.signature-container {
    grid-column: 1 / -1;
    /* se usi .form-grid a 2 colonne */
    width: 100%;
    max-width: 100%;
    margin: 20px 0;
}

/* Box del pad, centrato e con bordo coerente col form */
.signature-pad {
    margin: 0 auto;
    width: 100%;
    max-width: 600px;
    height: 160px;
    border: 2px solid #003d7a;
    border-radius: 4px;
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Canvas a piena larghezza all'interno del pad */
#canvas-firma-data {
    width: 100%;
    height: 100%;
    display: block;
    border: 1px solid #ccc;
    background-color: #fff;
    cursor: crosshair;
}

/* Bottone allineato sotto il pad */
.signature-container .button,
#clear-signature {
    display: inline-block;
    margin-top: 8px;
}

.signature-pad.error {
    border: 3px solid #dc3545 !important;
    animation: shake 0.3s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}


/* Mobile: pad sempre full-width */
@media (max-width: 768px) {
    .signature-pad {
        max-width: 100%;
        height: 140px;
    }

    .signature-container .button,
    #clear-signature {
        width: 100%;
        text-align: center;
    }
}


#formLoader {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999999; /* altissimo per sicurezza */
}

#formLoader.active {
    display: flex;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #e0e0e0;
    border-top: 6px solid #cc151c;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
