/* ==========================================
   TD STUDIOS - CONTACT PAGE
   ========================================== */

:root {
    --contact-padding-x: clamp(4rem, 10vw, 12rem);
}

/* ==========================================
   CONTACT HERO
   ========================================== */
.contact-hero {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 var(--contact-padding-x) 6rem;
    position: relative;
    background: var(--black);
    overflow: hidden;
}

/* Contact Hero Background Video */
.contact-hero-bg-video {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.2;
    pointer-events: none;
}

.contact-hero-bg-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact-hero-content {
    max-width: 800px;
    position: relative;
    z-index: 1;
}

.contact-label {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeUp 0.8s ease 0.2s forwards;
}

.contact-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 300;
    line-height: 1.1;
}

.contact-title .line {
    display: block;
    overflow: hidden;
}

.contact-title .line span {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: fadeUp 1s var(--transition-smooth) forwards;
}

.contact-title .line:nth-child(1) span {
    animation-delay: 0.3s;
}

.contact-title .line:nth-child(2) span {
    animation-delay: 0.4s;
}

.contact-title .line:nth-child(3) span {
    animation-delay: 0.5s;
}

.contact-title .highlight {
    color: var(--gold);
    font-style: italic;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   CONTACT MAIN
   ========================================== */
.contact-main {
    padding: 8rem var(--contact-padding-x);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 8rem;
}

/* ==========================================
   CONTACT INFO (Left Column)
   ========================================== */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.contact-block {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-block-label {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--light-gray);
    margin-bottom: 0.5rem;
}

.contact-email {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-email:hover {
    color: var(--gold);
}

.contact-phone {
    font-size: 1rem;
    color: var(--light-gray);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-phone:hover {
    color: var(--gold);
}

.contact-address {
    font-style: normal;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--light-gray);
}

.contact-social {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.social-link {
    font-size: 0.85rem;
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
    display: inline-block;
    width: fit-content;
}

.social-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s var(--transition-smooth);
}

.social-link:hover {
    color: var(--gold);
}

.social-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ==========================================
   CONTACT FORM (Right Column)
   ========================================== */
.contact-form-wrapper {
    padding-top: 1rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--light-gray);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.form-group:focus-within label {
    color: var(--gold);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.8rem 0;
    font-family: inherit;
    font-size: 1rem;
    color: var(--white);
    outline: none;
    transition: border-color 0.3s ease;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
}

.form-group select option {
    background: var(--black);
    color: var(--white);
}

.form-group textarea {
    resize: none;
    min-height: 120px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--gold);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--transition-smooth);
}

.form-group:focus-within .form-line {
    transform: scaleX(1);
}

.form-submit {
    margin-top: 2rem;
}

.submit-btn {
    display: inline-block;
    padding: 1.4rem 4rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: transparent;
    font-family: inherit;
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--white);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: color 0.4s ease, border-color 0.4s ease;
}

.submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s var(--transition-smooth);
    z-index: -1;
}

.submit-btn:hover {
    color: var(--black);
    border-color: var(--gold);
}

.submit-btn:hover::before {
    transform: scaleX(1);
}

.submit-btn span {
    position: relative;
    z-index: 1;
}

/* ==========================================
   CONTACT VISUAL (Bottom Section)
   ========================================== */
.contact-visual {
    height: 40vh;
    min-height: 300px;
    position: relative;
    background: linear-gradient(180deg, var(--black) 0%, rgba(20, 20, 20, 1) 50%, var(--black) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

/* Visual Section Background Video */
.contact-visual-bg-video {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.2;
    pointer-events: none;
}

.contact-visual-bg-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(201, 169, 98, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 50%, rgba(201, 169, 98, 0.02) 0%, transparent 40%);
    pointer-events: none;
}

.contact-visual-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.visual-label {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 300;
    color: var(--white);
    margin-bottom: 1rem;
}

.visual-location {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1024px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 5rem;
    }

    .contact-info {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 3rem;
    }

    .contact-block {
        min-width: 200px;
        flex: 1;
    }
}

@media (max-width: 768px) {
    :root {
        --contact-padding-x: 2rem;
    }

    .contact-hero {
        min-height: 50vh;
        padding-bottom: 4rem;
    }
    
    /* MOBILE FIX: Contact title dimensionato meglio */
    .contact-title {
        font-size: clamp(2.5rem, 8vw, 4rem);
        line-height: 1.15;
    }

    .contact-main {
        padding: 5rem var(--contact-padding-x);
    }

    .contact-info {
        flex-direction: column;
        gap: 3rem;
    }
    
    /* MOBILE FIX: Contact email leggibile */
    .contact-email {
        font-size: clamp(1.2rem, 4vw, 1.6rem);
        word-break: break-word;
    }

    .contact-form {
        gap: 2rem;
    }
    
    /* MOBILE FIX: Form inputs con touch target adeguato */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 1rem 0;
        font-size: 1rem;
    }
    
    .form-group textarea {
        min-height: 100px;
    }

    .contact-visual {
        height: 30vh;
        min-height: 200px;
    }
    
    /* MOBILE FIX: Visual label dimensionato */
    .visual-label {
        font-size: clamp(1.8rem, 5vw, 3rem);
        line-height: 1.3;
    }

    /* MOBILE FIX: Submit button full width con touch target */
    .submit-btn {
        width: 100%;
        text-align: center;
        min-height: 44px;
        padding: 1.2rem 3rem;
    }
}

/* MOBILE FIX: Schermi molto piccoli */
@media (max-width: 480px) {
    :root {
        --contact-padding-x: 1.5rem;
    }
    
    .contact-hero {
        padding-bottom: 3rem;
    }
    
    .contact-title {
        font-size: 2.2rem;
    }
    
    .contact-main {
        padding: 4rem var(--contact-padding-x);
    }
    
    .contact-email {
        font-size: 1.1rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 0.95rem;
    }
    
    .submit-btn {
        padding: 1rem 2rem;
        font-size: 0.65rem;
    }
}

/* ==========================================
   FORM FEEDBACK MESSAGES
   ========================================== */
.form-message {
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.form-message.visible {
    opacity: 1;
    transform: translateY(0);
}

.form-message.success {
    background: rgba(39, 174, 96, 0.15);
    border: 1px solid rgba(39, 174, 96, 0.3);
    color: #27ae60;
}

.form-message.error {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

/* Submit button states */
.submit-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.submit-btn.loading span::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.submit-btn.success {
    background: #27ae60;
    border-color: #27ae60;
}

.submit-btn.error {
    background: #e74c3c;
    border-color: #e74c3c;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}