/* ============================================================
   MAP Water Well Service — Contact Form Styles
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --cf-blue:       #022c5b;
    --cf-blue-mid:   #0369a1;
    --cf-blue-light: #bae6fd;
    --cf-green:      #16a34a;
    --cf-red:        #dc2626;
    --cf-gray-50:    #f8fafc;
    --cf-gray-100:   #f1f5f9;
    --cf-gray-200:   #e2e8f0;
    --cf-gray-400:   #94a3b8;
    --cf-gray-700:   #374151;
    --cf-radius:     10px;
    --cf-shadow:     0 4px 24px rgba(2, 44, 91, 0.10);
}

/* ── Page layout: two-column ────────────────────────────────── */
.contact-page-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
}

.contact-form-col {
    flex: 1 1 0;
    min-width: 0;
}

.contact-sidebar-col {
    flex: 0 0 300px;
    width: 300px;
}

/* ── Intro ──────────────────────────────────────────────────── */
.contact-page-intro {
    margin-bottom: 24px;
}

.contact-page-intro h1 {
    color: #022c5b;
    font-size: 26px;
    margin-bottom: 10px;
    margin-top: 0;
}

.contact-page-intro p {
    font-size: 15px;
    color: #374151;
    line-height: 1.7;
    margin: 0;
}

/* ── Service area banner ────────────────────────────────────── */
.service-area-note {
    background: linear-gradient(135deg, #022c5b 0%, #0369a1 100%);
    color: #ffffff;
    border-radius: 10px;
    padding: 16px 22px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.6;
}

.service-area-note strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

/* ── Form wrapper card ──────────────────────────────────────── */
#contact-form-wrapper {
    background: #ffffff;
    border-radius: var(--cf-radius);
    box-shadow: var(--cf-shadow);
    border: 1px solid var(--cf-gray-200);
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* ── Form header ────────────────────────────────────────────── */
#contact-form-wrapper .cf-header {
    background: linear-gradient(135deg, var(--cf-blue) 0%, var(--cf-blue-mid) 100%);
    padding: 24px 30px;
}

#contact-form-wrapper .cf-header h2 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #ffffff !important;
}

#contact-form-wrapper .cf-header p {
    margin: 0;
    font-size: 14px;
    color: #bae6fd !important;
    line-height: 1.5;
}

/* ── Form body ──────────────────────────────────────────────── */
#contact-form-wrapper form {
    padding: 28px 30px;
}

/* ── Field groups ────────────────────────────────────────────── */
.cf-field {
    margin-bottom: 18px;
}

.cf-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--cf-gray-700);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.cf-field label .cf-required {
    color: var(--cf-red);
    margin-left: 3px;
}

.cf-field input[type="text"],
.cf-field input[type="email"],
.cf-field input[type="tel"],
.cf-field textarea {
    width: 100%;
    padding: 10px 13px;
    font-size: 14px;
    color: var(--cf-gray-700);
    background: var(--cf-gray-50);
    border: 1.5px solid var(--cf-gray-200);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.cf-field input:focus,
.cf-field textarea:focus {
    border-color: var(--cf-blue-mid);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.12);
}

.cf-field textarea {
    resize: vertical;
    min-height: 110px;
}

/* ── Field states (ONLY shown after interaction) ─────────────── */
.cf-field.has-error input,
.cf-field.has-error textarea {
    border-color: var(--cf-red);
    background: #fff5f5;
}

.cf-field.has-success input,
.cf-field.has-success textarea {
    border-color: var(--cf-green);
}

/* Error message — hidden by default, shown only on has-error */
.cf-error-msg {
    display: none;
    margin-top: 5px;
    font-size: 12px;
    color: var(--cf-red);
    font-weight: 500;
    line-height: 1.4;
}

.cf-field.has-error .cf-error-msg {
    display: block;
}

/* ── Captcha ─────────────────────────────────────────────────── */
.cf-captcha-outer {
    margin-bottom: 18px;
}

.cf-captcha-outer label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--cf-gray-700);
    margin-bottom: 8px;
}

.cf-captcha-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cf-captcha-img {
    border: 1.5px solid var(--cf-gray-200);
    border-radius: 8px;
    display: block;
    height: 42px;
    cursor: pointer;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.cf-captcha-img:hover { opacity: 0.85; }

.cf-captcha-refresh {
    font-size: 12px;
    color: var(--cf-blue-mid);
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
}

.cf-captcha-row input[type="text"] {
    width: 130px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    letter-spacing: 3px;
    border: 1.5px solid var(--cf-gray-200);
    border-radius: 8px;
    background: var(--cf-gray-50);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.cf-captcha-row input[type="text"]:focus {
    border-color: var(--cf-blue-mid);
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.12);
}

.cf-captcha-outer.has-error .cf-captcha-row input[type="text"] {
    border-color: var(--cf-red);
    background: #fff5f5;
}

.cf-captcha-outer .cf-error-msg {
    display: none;
    margin-top: 6px;
    font-size: 12px;
    color: var(--cf-red);
    font-weight: 500;
}

.cf-captcha-outer.has-error .cf-error-msg {
    display: block;
}

/* ── Submit button ───────────────────────────────────────────── */
.cf-submit-btn {
    width: 100%;
    padding: 32px 24px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    color: #ffffff;
    background: linear-gradient(135deg, var(--cf-blue) 0%, var(--cf-blue-mid) 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 0.4px;
    transition: opacity 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.cf-submit-btn:hover { opacity: 0.92; transform: translateY(-1px); }
.cf-submit-btn:active { transform: translateY(0); }
.cf-submit-btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.cf-submit-btn .cf-spinner {
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: cf-spin 0.7s linear infinite;
}

.cf-submit-btn.loading .cf-spinner { display: inline-block; }
.cf-submit-btn.loading .cf-btn-text { opacity: 0.75; }

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

/* ── Response messages ───────────────────────────────────────── */
#cf-response {
    display: none;
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

#cf-response.success {
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    color: #15803d;
}

#cf-response.error {
    background: #fef2f2;
    border: 1.5px solid #fca5a5;
    color: #b91c1c;
}

/* ── Divider ─────────────────────────────────────────────────── */
.cf-divider {
    border: none;
    border-top: 1px solid var(--cf-gray-200);
    margin: 20px 0;
}

/* ── Sidebar cards ───────────────────────────────────────────── */
.contact-info-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px 22px;
    margin-bottom: 16px;
}

.contact-info-card h3 {
    color: #022c5b;
    font-size: 15px;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0369a1;
}

.contact-info-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-info-card ul li {
    padding: 7px 0;
    font-size: 13px;
    color: #374151;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
}

.contact-info-card ul li:last-child { border-bottom: none; }

.contact-info-card ul li strong {
    color: #022c5b;
    min-width: 55px;
    flex-shrink: 0;
}

.contact-info-card a { color: #0369a1; text-decoration: none; }
.contact-info-card a:hover { text-decoration: underline; }

.contact-info-card p {
    font-size: 13px;
    color: #374151;
    margin: 0 0 10px;
    line-height: 1.5;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 780px) {
    .contact-page-layout {
        flex-direction: column;
    }

    .contact-sidebar-col {
        flex: none;
        width: 100%;
    }

    #contact-form-wrapper .cf-header,
    #contact-form-wrapper form {
        padding: 20px 18px;
    }

    .cf-captcha-row { flex-direction: column; align-items: flex-start; }
}
