/**
 * Contact Form Template Styles
 * 
 * Styles for the custom contact form template based on Figma design
 * Integrates with Contact Form 7 plugin
 */

/* Main Container */
.contact-form-template {
    width: 100%;
    margin: 0 auto;
    background: #ffffff;
    position: relative;
    padding: 80px 20px;
    min-height: 1052px;
}

.contact-form-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* Header Section */
.contact-form-header {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 48px auto;
    text-align: center;
}

.contact-form-header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.contact-form-title {
    font-family: var(--proxima-nova-font) !important;
    font-size: 70px;
    font-weight: 600;
    line-height: 1;
    color: #1E1E1E;
    margin: 0;
    text-align: center;
    max-width: 900px;
}

/* Divider */
.contact-form-divider {
    width: 1px;
    height: 80px;
    background-color: #757575;
    margin: 0 auto 24px auto;
}

/* Form Section */
.contact-form-section {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* Ensure exact 600px form width on larger screens */
@media (min-width: 768px) {
    .contact-form-section {
        width: 600px;
    }
}

/* Contact Form 7 Styling */
.contact-form-section .wpcf7 {
    width: 100%;
}

.contact-form-section .wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

/* Form Fields Container */
.contact-form-section .wpcf7-form p {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Labels */
.contact-form-section .wpcf7-form label {
    font-family: var(--proxima-nova-font) !important;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.375;
    color: #1E1E1E;
    margin: 0 0 8px 0;
    display: block;
}

/* Input Fields */
.contact-form-section .wpcf7-form input[type="text"],
.contact-form-section .wpcf7-form input[type="email"],
.contact-form-section .wpcf7-form input[type="tel"],
.contact-form-section .wpcf7-form input[type="url"],
.contact-form-section .wpcf7-form select {
    width: 100%;
    height: 40px;
    background-color: #FFFFFF;
    border: 1px solid #D9D9D9;
    border-radius: 8px;
    padding: 12px 16px;
    font-family: var(--proxima-nova-font) !important;
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    color: #1E1E1E;
    box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form-section .wpcf7-form input[type="text"]:focus,
.contact-form-section .wpcf7-form input[type="email"]:focus,
.contact-form-section .wpcf7-form input[type="tel"]:focus,
.contact-form-section .wpcf7-form input[type="url"]:focus,
.contact-form-section .wpcf7-form select:focus {
    outline: none;
    border-color: #1E1E1E;
    box-shadow: 0 0 0 2px rgba(30, 30, 30, 0.1);
}

.contact-form-section .wpcf7-form input::placeholder {
    color: #B3B3B3; /* Exact Figma: rgb(179,179,179) */
    font-family: var(--proxima-nova-font) !important;
    opacity: 1; /* Ensure consistent placeholder opacity across browsers */
}

/* Textarea */
.contact-form-section .wpcf7-form textarea {
    width: 100%;
    min-height: 80px;
    background-color: #FFFFFF;
    border: 1px solid #D9D9D9;
    border-radius: 8px;
    padding: 12px 16px;
    font-family: var(--proxima-nova-font) !important;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.375;
    color: #1E1E1E;
    box-sizing: border-box;
    resize: vertical;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form-section .wpcf7-form textarea:focus {
    outline: none;
    border-color: #1E1E1E;
    box-shadow: 0 0 0 2px rgba(30, 30, 30, 0.1);
}

.contact-form-section .wpcf7-form textarea::placeholder {
    color: #B3B3B3; /* Exact Figma: rgb(179,179,179) */
    font-family: var(--proxima-nova-font) !important;
    opacity: 1; /* Ensure consistent placeholder opacity across browsers */
}

/* Submit Button */
.contact-form-section .wpcf7-form input[type="submit"],
.contact-form-section .wpcf7-form button[type="submit"] {
    /* Core visual styling */
    background-color: #000000 !important; /* Exact Figma black */
    color: #FFFFFF !important; /* Exact Figma white */
    border: none !important;
    border-radius: 100px !important; /* Fully rounded as per Figma */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    
    /* Exact dimensions from Figma */
    width: 166px !important; /* Updated Figma width: 166px */
    height: 56px !important; /* Exact Figma height: 56px */
    
    /* Typography */
    font-family: var(--proxima-nova-font) !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 24px !important; /* Perfect for 56px height */
    
    /* Layout and positioning */
    padding: 16px 52px 16px 24px !important; /* Asymmetric to account for icon */
    margin: 24px 0 0 auto !important; /* Positioned to right with top spacing */
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important; /* Text starts from left padding */
    
    /* Text alignment */
    text-align: left !important;
    text-indent: 0 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    vertical-align: middle !important;
    
    /* Behavior */
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
    position: relative !important;
    
    /* Text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Add send icon using pseudo-element positioned absolutely to match Figma design */
.contact-form-section .wpcf7-form input[type="submit"]::after,
.contact-form-section .wpcf7-form button[type="submit"]::after {
    content: "";
    position: absolute;
    right: 24px; /* 24px from right edge as per Figma */
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.01 21L23 12L2.01 3L2 10L17 12L2 14L2.01 21Z' fill='white'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
}

/* Hide icon on mobile for better text centering */
@media (max-width: 768px) {
    .contact-form-section .wpcf7-form input[type="submit"]::after,
    .contact-form-section .wpcf7-form button[type="submit"]::after {
        display: none;
    }
}

/* Remove duplicate styles - merged above */

.contact-form-section .wpcf7-form input[type="submit"]:hover,
.contact-form-section .wpcf7-form button[type="submit"]:hover {
    background-color: #333333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.contact-form-section .wpcf7-form input[type="submit"]:focus,
.contact-form-section .wpcf7-form button[type="submit"]:focus {
    outline: 2px solid #FFFFFF;
    outline-offset: 2px;
}

/* Form Validation Messages */
.contact-form-section .wpcf7-form .wpcf7-not-valid-tip {
    font-family: var(--proxima-nova-font) !important;
    font-size: 14px;
    color: #DC3545;
    margin-top: 4px;
    display: block;
}

.contact-form-section .wpcf7-form .wpcf7-not-valid {
    border-color: #DC3545 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1) !important;
}

/* Response Messages */
.contact-form-section .wpcf7-response-output {
    font-family: var(--proxima-nova-font) !important;
    font-size: 16px;
    margin: 24px 0 0 0;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

.contact-form-section .wpcf7-mail-sent-ok {
    background-color: #D4EDDA;
    color: #155724;
    border: 1px solid #C3E6CB;
}

.contact-form-section .wpcf7-mail-sent-ng {
    background-color: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
}

.contact-form-section .wpcf7-validation-errors {
    background-color: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
}

/* Spinner/Loading */
.contact-form-section .wpcf7-spinner {
    margin-left: 8px;
    visibility: hidden;
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #FFFFFF;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

.contact-form-section .wpcf7-form.submitting .wpcf7-spinner {
    visibility: visible;
}

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

/* Fallback Styling */
.cf7-fallback {
    text-align: center;
    padding: 40px;
    background-color: #F8F9FA;
    border-radius: 8px;
    border: 1px solid #E9ECEF;
}

.cf7-fallback p {
    font-family: var(--proxima-nova-font) !important;
    font-size: 16px;
    color: #6C757D;
    margin-bottom: 16px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .contact-form-template {
        padding: 60px 30px;
    }
    
    .contact-form-title {
        font-size: 56px;
    }
    
    .contact-form-divider {
        height: 60px;
    }
    
    /* Keep button right-aligned on tablet with proper text alignment */
    .contact-form-section .wpcf7-form input[type="submit"],
    .contact-form-section .wpcf7-form button[type="submit"] {
        margin: 20px 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        text-align: left !important;
        padding: 16px 52px 16px 24px !important;
    }
}

@media (max-width: 768px) {
    .contact-form-template {
        padding: 40px 20px;
        min-height: auto;
    }
    
    .contact-form-title {
        font-size: 44px;
        line-height: 1.1;
    }
    
    .contact-form-divider {
        height: 48px;
    }
    
    .contact-form-section {
        max-width: 100%;
    }
    
    .contact-form-section .wpcf7-form input[type="submit"],
    .contact-form-section .wpcf7-form button[type="submit"] {
        width: 100% !important; /* Full width on mobile */
        margin: 20px 0 0 0 !important; /* Centered on mobile */
        min-width: 166px !important; /* Maintain minimum width */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important; /* Center content on mobile */
        text-align: center !important; /* Center text on mobile */
        padding: 16px 52px !important; /* Symmetric padding for centered text */
    }
}

@media (max-width: 480px) {
    .contact-form-template {
        padding: 32px 16px;
    }
    
    .contact-form-title {
        font-size: 36px;
        line-height: 1.2;
    }
    
    .contact-form-divider {
        height: 40px;
    }
    
    .contact-form-section .wpcf7-form {
        gap: 20px;
    }
    
    .contact-form-section .wpcf7-form input[type="text"],
    .contact-form-section .wpcf7-form input[type="email"],
    .contact-form-section .wpcf7-form input[type="tel"],
    .contact-form-section .wpcf7-form input[type="url"],
    .contact-form-section .wpcf7-form select {
        height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .contact-form-section .wpcf7-form textarea {
        min-height: 100px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .contact-form-title {
        color: #000000;
    }
    
    .contact-form-section .wpcf7-form input[type="text"],
    .contact-form-section .wpcf7-form input[type="email"],
    .contact-form-section .wpcf7-form input[type="tel"],
    .contact-form-section .wpcf7-form input[type="url"],
    .contact-form-section .wpcf7-form select,
    .contact-form-section .wpcf7-form textarea {
        border: 2px solid #000000;
        background-color: #FFFFFF;
        color: #000000;
    }
    
    .contact-form-section .wpcf7-form input[type="submit"],
    .contact-form-section .wpcf7-form button[type="submit"] {
        background-color: #000000;
        color: #FFFFFF;
        border: 2px solid #000000;
    }
    
    .contact-form-section .wpcf7-form input[type="submit"]:hover,
    .contact-form-section .wpcf7-form button[type="submit"]:hover {
        background-color: #FFFFFF;
        color: #000000;
    }
    
    .contact-form-divider {
        background-color: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .contact-form-section .wpcf7-form input,
    .contact-form-section .wpcf7-form textarea,
    .contact-form-section .wpcf7-form button,
    .contact-form-section .wpcf7-spinner {
        transition: none;
        animation: none;
    }
    
    .contact-form-section .wpcf7-form input[type="submit"]:hover,
    .contact-form-section .wpcf7-form button[type="submit"]:hover {
        transform: none;
    }
}
