.seccio-contacte {
    width: 100%;
    max-width: 850px;
    margin: 40px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Contenidor translúcid del formulari */
.formulari-container {
    background: rgba(30, 30, 30, 0.65);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-sizing: border-box;
    text-align: left;
}

.nota-camps {
    color: #aa7c11;
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 0;
    margin-bottom: 25px;
}

/* Gestió de files i quadrícules per a camps dobles */
.grup-formulari {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 22px;
    width: 100%;
    box-sizing: border-box;
}

.grup-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Etiquetes i caixes d'entrada */
.formulari-premium label {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.formulari-premium input[type="text"],
.formulari-premium input[type="email"],
.formulari-premium input[type="tel"],
.formulari-premium textarea {
    background: rgba(15, 15, 15, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 12px 16px;
    color: #ffffff;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

/* Efecte focus: il·luminació daurada */
.formulari-premium input:focus,
.formulari-premium textarea:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
    background: rgba(20, 20, 20, 0.8);
}

/* Caixa RGPD Protecció de dades */
.capsa-legal {
    background: rgba(0, 0, 0, 0.25);
    border-left: 3px solid #d4af37;
    padding: 20px 25px;
    margin: 30px 0;
    border-radius: 0 8px 8px 0;
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word; /* Evita que els textos de PHP trenquin l'ample */
}

/* Corregits selectors erronis que trencaven el CSS global */
span[style*="font-weight: bold"], 
span[style*="font-weight:bold"] {
    display: block;
    font-size: 1.2rem !important;
    color: #e5c158 !important;
    margin-top: 15px;
    margin-bottom: 10px;
}

span[style*="font-weight: normal"], 
span[style*="font-weight:normal"] {
    display: block;
    font-size: 0.85rem !important;
    color: #cccccc !important;
    margin-bottom: 12px;
    line-height: 1.5;
}

/* Checkboxes d'acceptació */
.grup-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 14px;
}

.grup-checkbox input[type="checkbox"] {
    accent-color: #d4af37;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

.label-check {
    color: #cccccc !important;
    font-size: 0.85rem !important;
    line-height: 1.4;
    cursor: pointer;
}

.label-check a {
    color: #d4af37;
    text-decoration: underline;
}

/* Verificació Antispam */
.captcha-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
}

.imatge-captcha-simulada {
    background-color: #222222;
    background-image: 
        linear-gradient(45deg, rgba(212, 175, 55, 0.15) 25%, transparent 25%), 
        linear-gradient(-45deg, rgba(212, 175, 55, 0.15) 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, rgba(212, 175, 55, 0.15) 75%), 
        linear-gradient(-45deg, transparent 75%, rgba(212, 175, 55, 0.15) 75%);
    background-size: 10px 10px;
    border: 1px solid #d4af37;
    border-radius: 6px;
    padding: 10px 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9), 0 4px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    height: 48px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.lletra-c {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.6rem;
    font-weight: 900;
    color: #e5c158;
    text-shadow: 2px 3px 2px rgba(0, 0, 0, 0.9), 0 0 5px rgba(212, 175, 55, 0.5);
    display: inline-block;
    letter-spacing: 3px;
}

.cap-1 { transform: rotate(-8deg) translateY(-2px); }
.cap-2 { transform: rotate(12deg) translateY(3px); color: #d4af37; }
.cap-3 { transform: rotate(-14deg) translateY(-1px); font-size: 1.7rem; }
.cap-4 { transform: rotate(6deg) translateY(2px); }
.cap-5 { transform: rotate(-5deg) translateY(-3px); color: #f39c12; }

.captcha-wrapper input {
    flex: 1;
    height: 48px;
    box-sizing: border-box;
}

/* Botó Enviar */
button.btn-reserva.btn-enviar-formulari {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 14px 10px !important; /* El padding lateral bajo evita que el texto rompa el ancho */
    font-size: 1rem !important;
    letter-spacing: 1px !important; /* Reducimos ligeramente el espacio entre letras para que quepa en pantallas pequeñas */
    box-sizing: border-box !important;
    margin: 20px 0 0 0 !important;
    position: relative !important; /* Anula posibles absolute o fixed que vengan de general.css */
    transform: none !important; /* Evita desfases por traslaciones */
    float: none !important;
    white-space: normal !important; /* Si el texto no cabe en móviles muy estrechos, baja a la siguiente línea en lugar de estirar el botón */
}
/* Validacions visuals d'error */
input:hover, textarea:hover {
    border-color: #c7c4b8;
}

input:invalid:not(:placeholder-shown):not(:focus),
textarea:invalid:not(:placeholder-shown):not(:focus) {
    border-color: #FF6B6B;
}

.grup-formulari.has-error .error-msg { 
    display: block; 
}

.grup-formulari.has-error input,
.grup-formulari.has-error textarea { 
    border-color: #FF6B6B; 
}

.error-msg {
    font-size: 12.5px;
    color: #FF6B6B;
    margin-top: 6px;
    display: none;
}
/* --- ADAPTACIÓ MÒBIL PER FORMULARI --- */
@media (max-width: 768px) {
    /* Amb la capsalera sticky ja no cal compensar la seva alcada: nomes espaiat normal */
    .content-contacte {
        padding-top: 30px !important;
    }

    .formulari-container {
        padding: 25px 15px;
        border-radius: 8px;
    }
    
    .grup-grid-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .capsa-legal {
        padding: 15px 12px;
    }

    .captcha-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .imatge-captcha-simulada {
        width: 100%;
        text-align: center;
    }

}