.contact {
    background: var(--bg-alt);
}

.contact-col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
}

.contact-container {
    margin-top: 4rem;
    background: var(--bg);
    padding: 4rem;
    border-radius: 1rem;
}

.contact-container h4 {
    margin-bottom: 2rem;
}

/* --- Establish the 2-Column Grid Canvas --- */
.contact-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* --- Control Spans and Grid Placement --- */
.half-width {
    grid-column: span 1;
}

.full-width {
    grid-column: span 2;
}

/* --- Form Input Fields Premium Styling --- */
.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.form-group input, 
.form-group textarea {
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    background: var(--bg);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-group input:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(var(--text-primary-rgb), 0.05);
}

/* --- Captcha Styling Tweaks --- */
.captcha-group input {
    max-width: 200px; /* Limits size to look sharp next to text */
}

/* --- The Submit Action & Flex Stretch Fix --- */
.form-actions {
    display: flex;
    justify-content: flex-start; /* Aligns button to the left border edge */
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem; /* Gap between your text string and the arrow icon */
    padding: 1rem 2rem;
    background: var(--text-primary);
    color: var(--bg); /* Flips dark/light accents cleanly */
    border: none;
    border-radius: 0.35rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-start; /* CRITICAL FIX: Stops button stretching across screen grid */
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.submit-btn:active {
    transform: translateY(1px);
}

.btn-icon {
    font-size: 0.9rem; /* Subtle scale matching text flow layout */
}

/* --- Form Status Message Alerts --- */
.form-alert {
    padding: 1rem;
    margin-bottom: 2rem;
    border-radius: 0.35rem;
    background: var(--border);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.second-col {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    padding-top: 4rem;
    
}

.contact-info {
    background: var(--bg);
    padding: 4rem;
    border-radius: 1rem;
}

.address {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.address-text p {
    margin: 0;
}

.address-title {
    font-weight: 600;
}

.address-icon {
    margin-top: 2px;
}

.contact-intro { max-width: 80%; margin: 0 auto;}

/* --- Live Input Validation States --- */
.form-group.has-error input,
.form-group.has-error textarea {
    border-color: var(--red);
    
}

.error-message {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--red);
    margin-top: 0.25rem;
    display: block;
    animation: fieldFadeIn 0.2s ease forwards;
}



@keyframes fieldFadeIn {
    from { opacity: 0; transform: translateY(-3px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive Adaptability Strategy --- */
@media (max-width: 1024px) {
    .contact-col { grid-template-columns: 1fr;}
    .form-group label { font-size: 1.2rem;}
    .form-group input, .form-group textarea { font-size: 1.5rem;}
    .address-icon { margin-top: 4px; font-size: 1.5rem;}
    .address { gap: 2rem;}
    
    
}


@media (max-width: 768px) {

    
    .contact-intro p { margin-bottom: 4rem;}
    /* 1. Target ONLY the container inside the contact section, leaving the header safe */
    #contact .container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
    }

    /* 2. Strip card aesthetics and bleed blocks to full viewport footprint */
    .contact-container,
    .contact-info {
        width: 100vw;
        border-radius: 0; /* Strips out the rounded card edges */
        margin-top: 0;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
        
        /* Apply 10% padding on left/right to keep interior content exactly at 80% width */
        padding: 3rem 10% !important; 
    }

    /* Keep some visual breathing room between the form section and the contact details block */
    .second-col {
        margin-top: 2rem;
        gap: 2rem;
        padding-top: 0;
    }
    
    .contact-info {
        border-top: 1px solid var(--border); /* Subtle separator since card outlines are gone */
    }

    /* 3. Drop layout grid frameworks into vertical lines */
    .contact-col {
        display: block;
        width: 100%;
    }

    .contact-form {
        gap: 1.5rem; 
    }

    .half-width {
        grid-column: span 2;
    }

    /* 4. Form elements span full width of their 80% wrapper system */
    .form-group input, 
    .form-group textarea,
    .captcha-group input {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Make the action button sit comfortably on mobile frames */
    .form-actions .btn-primary {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    

}