.sec1 {
    background-image: linear-gradient(to bottom, rgba(212, 212, 212, 0.8), rgba(230, 229, 229, 0.8)), url("../img/fondo_programacio.webp");
    min-height: 100vh; /* Garantim que ocupi tota la pantalla */
    background-attachment: fixed;
    background-position: center; /* Centrem millor la imatge */
    background-repeat: no-repeat;
    background-size: cover;
    padding: 5% 5%; /* Percentatges per adaptar-se millor a diferents pantalles */
    display: flex; /* Flexbox per centrar contingut */
    align-items: flex-start; /* Centrem el contingut verticalment */
    justify-content: center; /* Centrem el contingut horitzontalment */
    box-sizing: border-box; /* Assegura't que el padding no augmenti l'amplada */
    color: #333; /* Text fosc per contrastar */
}
.sec1 p{
    font-size: 18px;
}
.img1{
    height: 150px;
    width: 800px;
}

/* 🔹 Contenidor d'icones */
.social-icons {
    display: flex;
    justify-content: start;
    gap: 10px;
}



/* 🔹 Botons de xarxes socials */
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    font-size: 30px;
    color: #fff;
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
}


/* 🔹 Colors per cada xarxa */
.instagram { background: #E4405F; }
.facebook { background: #3b5998; }
.twitter { background: #000; }
.telegram { background: #0088cc; }
.whatsapp { background: #25D366; }
.yara { background: #ecc600; }


/* 🔹 Ombra personalitzada de cada xarxa social */
.instagram:hover { box-shadow: 0px 0px 15px rgba(228, 64, 95, 0.8); }
.facebook:hover { box-shadow: 0px 0px 15px rgba(59, 89, 152, 0.8); }
.twitter:hover { box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.8); }
.telegram:hover { box-shadow: 0px 0px 15px rgba(0, 136, 204, 0.8); }
.whatsapp:hover { box-shadow: 0px 0px 15px rgba(37, 211, 102, 0.8); }
.yara:hover { box-shadow: 0px 0px 15px rgba(236, 198, 0,0.8); }


/* 🔹 Manté el color blanc dels icones en hover */
.social-btn:hover  {
    color: #fff !important;
    transform: scale(1.1);
}


/*🔹 Estils per a dispositius tablets */
@media (max-width: 1200px) {
    .sec1 {
        background-attachment: scroll; /* Canvia de 'fixed' a 'scroll' per evitar problemes en mòbil */
        background-position: center; /* Ajusta la posició de la imatge */
        min-height: 200px; /* Redueix l'alçada mínima per a pantalles més petites */
        padding-top: 50px; /* Ajusta el padding superior per a mòbil */
        padding-bottom: 50px;
    }
 
    
}


/*🔹 Estils per a dispositius mòbils */
@media (max-width: 768px) {
    .sec1 {
        background-attachment: scroll;
        background-position: center;
        min-height: 200px;
        padding-top: 80px;
        padding-bottom: 50px;
    }
    .sec1 p{
        font-size: 16px;
    }
    .social-icons {
        display: flex;
        justify-content: center;
        gap: 10px;
    }
}


/* ===================================================================
   CONTACT FORM SECTION
   =================================================================== */
.contact-form-section {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0a0a0a 100%);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}
.contact-form-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(236, 198, 0, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(236, 198, 0, 0.02) 0%, transparent 50%);
    pointer-events: none;
}

/* Card */
.contact-form-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(236, 198, 0, 0.15);
    border-radius: 20px;
    padding: 50px 45px;
    backdrop-filter: blur(10px);
    position: relative;
}
.contact-form-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ecc600, transparent);
    border-radius: 20px 20px 0 0;
}

/* Header */
.contact-form-header {
    text-align: center;
    margin-bottom: 40px;
}
.contact-form-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #ecc600, #d4a800);
    border-radius: 50%;
    font-size: 28px;
    color: #121212;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(236, 198, 0, 0.3);
}
.contact-form-header h2 {
    color: #ecc600;
    font-size: 2.2rem;
    margin-bottom: 8px;
}
.contact-form-header p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
}

/* Floating label fields */
.form-floating-custom {
    position: relative;
    margin-bottom: 0;
}
.form-floating-custom input,
.form-floating-custom textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1rem;
    padding: 24px 0 8px 0;
    outline: none;
    transition: border-color 0.3s;
    font-family: 'Public Sans', sans-serif;
}
.form-floating-custom textarea {
    resize: vertical;
    min-height: 120px;
}
.form-floating-custom label {
    position: absolute;
    left: 0;
    top: 22px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.95rem;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.form-floating-custom input:focus ~ label,
.form-floating-custom input:not(:placeholder-shown) ~ label,
.form-floating-custom textarea:focus ~ label,
.form-floating-custom textarea:not(:placeholder-shown) ~ label,
.form-floating-custom input.has-value ~ label,
.form-floating-custom textarea.has-value ~ label {
    top: 2px;
    font-size: 0.75rem;
    color: #ecc600;
}
.form-floating-custom .field-line {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #ecc600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.form-floating-custom input:focus ~ .field-line,
.form-floating-custom textarea:focus ~ .field-line {
    left: 0;
    width: 100%;
}

/* Character counter */
.char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 4px;
}

/* Captcha button */
.btn-captcha {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 36px;
    background: transparent;
    border: 2px solid rgba(236, 198, 0, 0.5);
    color: #ecc600;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Public Sans', sans-serif;
}
.btn-captcha:hover {
    background: rgba(236, 198, 0, 0.1);
    border-color: #ecc600;
    box-shadow: 0 0 25px rgba(236, 198, 0, 0.2);
    transform: translateY(-2px);
}

/* Submit button */
.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 48px;
    background: linear-gradient(135deg, #ecc600, #d4a800);
    border: none;
    color: #121212;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Public Sans', sans-serif;
    box-shadow: 0 6px 24px rgba(236, 198, 0, 0.35);
}
.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(236, 198, 0, 0.5);
}
.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-submit.sending {
    pointer-events: none;
    opacity: 0.7;
}

/* Form messages */
.form-message {
    text-align: center;
    padding: 14px 20px;
    border-radius: 12px;
    margin-top: 20px;
    font-weight: 500;
}
.form-message.success {
    background: rgba(40, 167, 69, 0.15);
    color: #5cdb6f;
    border: 1px solid rgba(40, 167, 69, 0.3);
}
.form-message.error {
    background: rgba(220, 53, 69, 0.15);
    color: #ff6b7a;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Legal text */
.form-legal {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 24px;
    margin-bottom: 0;
}
.form-legal a {
    color: #ecc600;
    text-decoration: none;
}
.form-legal a:hover {
    text-decoration: underline;
}

/* ===================================================================
   PUZZLE CAPTCHA MODAL
   =================================================================== */
.puzzle-modal-content {
    background: #1a1a2e;
    border: 1px solid rgba(236, 198, 0, 0.25);
    border-radius: 16px;
    overflow: hidden;
}
.puzzle-modal-header {
    background: linear-gradient(135deg, rgba(236, 198, 0, 0.15), transparent);
    border-bottom: 1px solid rgba(236, 198, 0, 0.15);
    color: #ecc600;
    padding: 16px 20px;
}
.puzzle-instructions {
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 16px;
    font-size: 0.9rem;
}
.puzzle-container {
    position: relative;
    display: inline-block;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(236, 198, 0, 0.2);
}
#puzzleCanvas {
    display: block;
    border-radius: 10px;
}
.puzzle-feedback {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 4px 14px;
    border-radius: 20px;
    display: none;
}
.puzzle-feedback.success {
    display: block;
    background: rgba(40, 167, 69, 0.9);
    color: #fff;
}
.puzzle-feedback.fail {
    display: block;
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
}

/* Slider */
.slider-container {
    padding: 20px 30px 10px;
}
.slider-track {
    position: relative;
    height: 44px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    border: 1px solid rgba(236, 198, 0, 0.2);
    overflow: hidden;
    cursor: pointer;
}
.slider-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ecc600, #d4a800);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #121212;
    font-size: 16px;
    cursor: grab;
    z-index: 2;
    transition: box-shadow 0.2s;
    user-select: none;
    touch-action: none;
}
.slider-thumb:active {
    cursor: grabbing;
    box-shadow: 0 0 20px rgba(236, 198, 0, 0.5);
}
.slider-progress {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 42px;
    background: rgba(236, 198, 0, 0.1);
    border-radius: 22px;
    transition: none;
}
.slider-thumb.solved {
    background: linear-gradient(135deg, #28a745, #20c997);
    cursor: default;
}

/* ===================================================================
   RESPONSIVE FORM
   =================================================================== */
@media (max-width: 768px) {
    .contact-form-section {
        padding: 50px 0;
    }
    .contact-form-card {
        padding: 30px 20px;
        border-radius: 14px;
    }
    .contact-form-header h2 {
        font-size: 1.7rem;
    }
    .contact-form-icon {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }
    .btn-captcha, .btn-submit {
        padding: 12px 28px;
        font-size: 0.95rem;
    }
    .slider-container {
        padding: 16px 10px 6px;
    }
}