/* =================================================
   ESTILS ESPECÍFICS PER LA PÀGINA DE CONTACTE
   Disseny optimitzat per a conversió i UX
   ================================================= */

/* ============================================
   NAVEGACIÓ ESPECÍFICA DE CONTACTE
   ============================================ */
nav ul li a.active {
    color: var(--color-accent) !important;
    font-weight: 600;
    position: relative;
}

nav ul li a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-accent);
    border-radius: 1px;
}

header.scrolled nav ul li a.active {
    color: var(--color-accent) !important;
}

/* ============================================
   VARIABLES ESPECÍFIQUES DE CONTACTE
   ============================================ */
:root {
    --contact-gradient: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    --contact-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --contact-shadow-light: 0 5px 15px rgba(0, 0, 0, 0.05);
    --contact-border-radius: 15px;
    --contact-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   HERO SECTION DE CONTACTE
   ============================================ */
.contact-hero {
    background: var(--contact-gradient);
    padding: 140px 0 80px;
    position: relative;
    overflow: hidden;
}

.contact-hero .contact-hero-img {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0.35;
    z-index: 1;
    pointer-events: none; /* decorative */
}

.contact-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.contact-hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.contact-hero h1 {
    font-size: 3.5rem;
    color: white;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.contact-hero-subtitle {
    font-size: 1.3rem;
    color: white;
    margin-bottom: 40px;
    line-height: 1.6;
    opacity: 0.95;
}

.contact-hero-features {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 500;
    transition: var(--contact-transition);
}

.hero-feature:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.hero-feature i {
    font-size: 1.2rem;
    color: white;
}

/* ============================================
   ALERTES I MISSATGES
   ============================================ */
.alert {
    padding: 18px 24px;
    border-radius: var(--contact-border-radius);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: slideInAlert 0.5s ease;
    box-shadow: var(--contact-shadow-light);
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert i {
    font-size: 1.3rem;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    opacity: 0.7;
    transition: var(--contact-transition);
}

.alert-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

@keyframes slideInAlert {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   SECCIÓ PRINCIPAL DE CONTACTE
   ============================================ */
.contact-main {
    padding: 80px 0;
    background: #f8f9fa;
}

.contact-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
    align-items: start;
}

/* ============================================
   FORMULARI DE CONTACTE
   ============================================ */
.contact-form-section {
    background: white;
    padding: 40px;
    border-radius: var(--contact-border-radius);
    box-shadow: var(--contact-shadow);
    position: relative;
    overflow: hidden;
}

.contact-form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--contact-gradient);
}

.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-header h2 {
    font-size: 2.2rem;
    color: var(--color-dark);
    margin-bottom: 15px;
    font-weight: 600;
}

.form-header p {
    color: #6c757d;
    font-size: 1.1rem;
    line-height: 1.6;
}

.contact-form {
    display: grid;
    gap: 25px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--color-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.form-group label i {
    color: var(--color-accent);
    font-size: 1rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 15px 18px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--contact-transition);
    background: #fff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(var(--color-accent), 0.1);
    transform: translateY(-2px);
}

.form-group textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.6;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
}

/* Checkbox personalitzat */
.form-checkbox {
    margin: 10px 0;
}

.checkbox-label {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #495057;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    transition: var(--contact-transition);
    margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--color-accent);
    border-color: var(--color-accent);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label a {
    color: var(--color-accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--contact-transition);
}

.checkbox-label a:hover {
    border-bottom-color: var(--color-accent);
}

/* Botó d'enviament */
.btn-submit {
    padding: 18px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    background: var(--contact-gradient);
    border: none;
    color: white;
    cursor: pointer;
    transition: var(--contact-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(var(--color-accent), 0.3);
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(var(--color-accent), 0.4);
}

.btn-submit:active {
    transform: translateY(-1px);
}

.form-note {
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.form-note i {
    color: var(--color-accent);
}

/* ============================================
   INFORMACIÓ DE CONTACTE
   ============================================ */
.contact-info-section {
    background: white;
    padding: 40px 30px;
    border-radius: var(--contact-border-radius);
    box-shadow: var(--contact-shadow);
    height: fit-content;
    position: sticky;
    top: 120px;
}

.contact-info-header {
    text-align: center;
    margin-bottom: 35px;
}

.contact-info-header h3 {
    font-size: 1.8rem;
    color: var(--color-dark);
    margin-bottom: 10px;
    font-weight: 600;
}

.contact-info-header p {
    color: #6c757d;
    line-height: 1.6;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 40px;
}

.contact-method {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    border-radius: 12px;
    background: #f8f9fa;
    transition: var(--contact-transition);
    border: 1px solid transparent;
}

.contact-method:hover {
    background: #fff;
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: var(--contact-shadow-light);
}

.contact-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--contact-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-icon i {
    font-size: 1.3rem;
    color: white;
}

.contact-details h4 {
    font-size: 1.1rem;
    color: var(--color-dark);
    margin-bottom: 5px;
    font-weight: 600;
}

.contact-details p {
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 5px;
    font-weight: 500;
}

.contact-note {
    font-size: 0.85rem;
    color: #6c757d;
    font-style: italic;
}

/* ============================================
   XARXES SOCIALS
   ============================================ */
.social-media {
    border-top: 1px solid #e9ecef;
    padding-top: 30px;
}

.social-media h4 {
    font-size: 1.2rem;
    color: var(--color-dark);
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.social-links {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: #f8f9fa;
    border-radius: 10px;
    text-decoration: none;
    color: var(--color-text);
    transition: var(--contact-transition);
    font-weight: 500;
    border: 1px solid transparent;
}

.social-link:hover {
    background: var(--color-accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--contact-shadow-light);
}

.social-link i {
    font-size: 1.1rem;
}

/* ============================================
   SECCIÓ CTA
   ============================================ */
.contact-cta {
    background: var(--contact-gradient);
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.contact-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../img/Portada.jpg') center/cover;
    opacity: 0.1;
    z-index: 1;
}

.cta-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 2.8rem;
    color: white;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.cta-content p {
    font-size: 1.3rem;
    color: white;
    margin-bottom: 40px;
    line-height: 1.6;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-buttons .btn {
    padding: 18px 35px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    transition: var(--contact-transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.cta-buttons .btn-primary {
    background: white;
    color: var(--color-accent);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.cta-buttons .btn-primary:hover {
    background: #f8f9fa;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.4);
}

.cta-buttons .btn-secondary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.cta-buttons .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
}

/* ============================================
   ANIMACIONS
   ============================================ */
.animate-in {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1200px) {
    .contact-grid {
        gap: 40px;
    }
    
    .contact-info-section {
        position: static;
    }
}

@media (max-width: 992px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    
    .contact-hero h1 {
        font-size: 2.8rem;
    }
    
    .contact-hero-features {
        gap: 20px;
    }
    
    .hero-feature {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .contact-form-section,
    .contact-info-section {
        padding: 30px 25px;
    }
    
    .cta-content h2 {
        font-size: 2.2rem;
    }
    
    .cta-content p {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .contact-hero {
        padding: 120px 0 60px;
    }
    
    .contact-hero h1 {
        font-size: 2.2rem;
    }
    
    .contact-hero-subtitle {
        font-size: 1.1rem;
    }
    
    .contact-hero-features {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .contact-main {
        padding: 60px 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .contact-form-section,
    .contact-info-section {
        padding: 25px 20px;
    }
    
    .social-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .social-link {
        justify-content: center;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .contact-cta {
        padding: 60px 0;
    }
    
    .cta-content h2 {
        font-size: 1.8rem;
    }
    
    .cta-content p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .contact-hero h1 {
        font-size: 1.8rem;
    }
    
    .contact-hero-subtitle {
        font-size: 1rem;
    }
    
    .contact-form-section,
    .contact-info-section {
        padding: 20px 15px;
    }
    
    .form-header h2 {
        font-size: 1.8rem;
    }
    
    .contact-method {
        padding: 15px;
    }
    
    .contact-icon {
        width: 45px;
        height: 45px;
    }
    
    .contact-icon i {
        font-size: 1.1rem;
    }
}

/* ============================================
   MILLORES D'ACCESSIBILITAT
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible per navegació amb teclat */
.btn:focus-visible,
.form-group input:focus-visible,
.form-group textarea:focus-visible,
.form-group select:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.social-link:focus-visible,
.checkbox-label:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 8px;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .contact-hero,
    .contact-cta,
    .social-media {
        display: none;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .contact-form-section,
    .contact-info-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}