/**
 * Contact Page Styles - Metal America Concrete
 * Mobile-first responsive design
 */

/* ===================================
   Honeypot Field (Hidden)
   =================================== */
.hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

/* ===================================
   Page Container
   =================================== */
.contact-page {
    background-color: var(--mac-white);
}

.contact-page-container {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 20px 15px 40px;
    box-sizing: border-box;
}

.contact-form-wrapper {
    background: var(--mac-white);
}

/* ===================================
   Form Title & Subtitle
   =================================== */
.contact-form-title {
    font-family: var(--mac-font);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--mac-gray-800);
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.contact-form-subtitle {
    font-family: var(--mac-font);
    font-size: 1rem;
    color: var(--mac-gray-600);
    margin: 0 0 25px 0;
    line-height: 1.5;
}

/* ===================================
   Form Sections
   =================================== */
.form-section {
    margin-bottom: 10px;
}

.form-section.form-row {
    margin-bottom: 10px;
}

/* ===================================
   Phone Banner
   =================================== */
.contact-phone-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background-color: var(--mac-gray-50);
    border: 1px solid var(--mac-gray-200);
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    box-sizing: border-box;
}

.contact-phone-banner:hover {
    background-color: var(--mac-white);
    border-color: var(--mac-gray-800);
    text-decoration: none;
}

.contact-phone-icon {
    width: 18px;
    height: 18px;
    color: var(--mac-gray-800);
    flex-shrink: 0;
}

.contact-phone-text {
    font-family: var(--mac-font);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--mac-gray-800);
}

.contact-phone-number {
    color: var(--mac-red);
}

/* ===================================
   Form Row (2-column layout)
   Mobile: Stack vertically
   =================================== */
.form-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===================================
   Form Groups
   =================================== */
.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    font-family: var(--mac-font);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--mac-gray-800);
    margin-bottom: 6px;
}

.required {
    color: var(--mac-red);
}

/* ===================================
   Input Fields
   =================================== */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    font-family: var(--mac-font);
    font-size: 16px;
    color: var(--mac-gray-800);
    background-color: var(--mac-gray-50);
    border: 2px solid transparent;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    box-sizing: border-box;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #999999;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--mac-red);
    background-color: var(--mac-white);
}

.form-group input.error,
.form-group textarea.error,
.form-group select.error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* ===================================
   Field Errors
   =================================== */
.field-error {
    min-height: 20px;
    margin-top: 4px;
    font-family: var(--mac-font);
    font-size: 0.8rem;
    color: #dc3545;
    line-height: 1.3;
}

/* ===================================
   Consent Section
   =================================== */
.consent-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--mac-gray-200);
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 2px 0 0 0;
    cursor: pointer;
    accent-color: var(--mac-red);
    flex-shrink: 0;
}

.checkbox-group label {
    font-family: var(--mac-font);
    font-size: 0.9rem;
    color: var(--mac-gray-800);
    line-height: 1.5;
    cursor: pointer;
}

.checkbox-group label a {
    color: var(--mac-red);
    text-decoration: underline;
}

.consent-disclaimer {
    font-family: var(--mac-font);
    font-size: 0.8rem;
    color: var(--mac-gray-800);
    opacity: 0.7;
    margin: 8px 0 0 0;
    line-height: 1.4;
}

/* ===================================
   Form Messages
   =================================== */
.form-messages {
    margin: 20px 0;
}

.error-message {
    padding: 12px 16px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    font-family: var(--mac-font);
    font-size: 0.9rem;
    color: #721c24;
}

.error-message strong {
    font-weight: 700;
}

/* ===================================
   Submit Button
   =================================== */
.submit-section {
    margin-top: 25px;
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 40px;
    background-color: var(--mac-black);
    color: var(--mac-white);
    font-family: var(--mac-font);
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.submit-btn:hover {
    background-color: #222222;
}

.submit-btn:active {
    background-color: var(--mac-black);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-loader::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: var(--mac-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===================================
   Error Shake Animation
   =================================== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* ===================================
   Tablet (768px+)
   =================================== */
@media (min-width: 768px) {
    .contact-page-container {
        padding: 30px 20px 50px;
    }

    .contact-form-title {
        font-size: 2rem;
        margin-bottom: 10px;
    }

    .form-row {
        flex-direction: row;
        gap: 20px;
    }
}

/* ===================================
   Desktop (1024px+)
   =================================== */
@media (min-width: 1024px) {
    .contact-page-container {
        padding: 40px 30px 60px;
    }

    .contact-form-title {
        font-size: 2.25rem;
    }

    .form-row {
        gap: 30px;
    }
}

/* ===================================
   Focus Visible (Accessibility)
   =================================== */
.submit-btn:focus-visible,
.checkbox-group input:focus-visible {
    outline: 2px solid var(--mac-red);
    outline-offset: 2px;
}

/* ===================================
   Reduced Motion
   =================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
