* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@keyframes dropInDown {
    from {
        opacity: 0;
        transform: translateY(-150%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    position: relative;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: bold;
}

.video-background {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    filter: blur(4px);
}

/* Header */
header {
    background: rgba(0, 0, 0, 0);
    color: white;
    padding: 1rem 0;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 10;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    height: auto;
}

.logo-img {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 14px rgba(255, 255, 255, 0.6)) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s;
}

.logo:hover .logo-img {
    transform: scale(1.05);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

nav a:hover {
    color: #eb551a;
}

/* Pre-header */
.pre-header {
    background: url('../images/pre-header.jpg') repeat-x center;
    background-size: auto 100%;
    height: 40px;
    width: 100%;
}

/* Main */
main {
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0);
}

/* Logo centrato sopra il riquadro */
main .logo {
    display: flex;
    justify-content: center;
}

.container {
    max-width: 500px;
    background: white;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    animation-duration: 0.8s;
    animation-delay: 2s;
    animation-fill-mode: both;
}

.container h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #004289;
}

.container p {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

input[type="text"],
input[type="email"],
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    font-size: 16px;
    transition: border-color 0.3s;
    background: white;
    font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
    outline: none;
    border-color: #004289;
    box-shadow: 0 0 0 3px rgba(0, 66, 137, 0.1);
}

/* Honeypot: nascosto agli utenti, compilato solo dai bot */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

input::placeholder {
    color: #757575;
    opacity: 1;
}

/* Il placeholder della select (value vuoto) appare grigio */
select:invalid {
    color: #757575;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

input[type="checkbox"] {
    margin-top: 5px;
    cursor: pointer;
}

.checkbox-group label {
    margin-bottom: 0;
    font-weight: 400;
    font-size: 14px;
}

.btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #004289 0%, #eb551a 100%);
    color: white;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 66, 137, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Messages */
.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert ul {
    list-style: none;
    padding: 0;
}

.alert li {
    margin: 5px 0;
}

/* Footer */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 14px;
}

footer p {
    margin: 0;
}

/* Modal Custom */
.modal-custom {
    border: none;
    border-radius: 0;
    box-shadow: 0 10px 60px rgba(0, 66, 137, 0.2);
}

.modal-custom .modal-header {
    background: linear-gradient(135deg, #004289 0%, #eb551a 100%);
    color: white;
    padding: 20px;
    border-radius: 0;
}

.modal-custom .modal-title {
    font-weight: bold;
    font-size: 20px;
}

.modal-custom .btn-close {
    filter: brightness(0) invert(1);
}

.modal-custom .modal-body {
    padding: 30px;
    background: #f9f9f9;
}

.confirm-details {
    background: white;
    padding: 15px;
    margin: 15px 0;
    border-left: 4px solid #004289;
}

.confirm-details p {
    margin: 10px 0;
    font-size: 14px;
}

.modal-custom .modal-footer {
    padding: 20px;
    background: white;
}

.modal-custom .btn-secondary {
    background: #ddd;
    color: #333;
    border: none;
}

.modal-custom .btn-secondary:hover {
    background: #ccc;
}

.modal-custom .btn-primary {
    color: white;
    border: none;
}

.modal-custom .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 66, 137, 0.3);
}

/* Animate modal */
.modal.fade .modal-dialog {
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    nav ul {
        gap: 1rem;
    }

    nav a {
        font-size: 14px;
    }

    .container {
        padding: 30px 20px;
    }

    .container h1 {
        font-size: 24px;
    }
}
