/**
 * Secure Contact Form Styles - Matching WPForms
 */

/* ── Form Container ── */
.scf-contact-form {
    max-width: 700px;
    margin: 0 auto;
    padding: 0;
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Form Fields ── */
.scf-field {
    margin-bottom: 20px;
}

.scf-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 16px;
    color: #1a1a1a;
    line-height: 1.4;
}

.scf-field input,
.scf-field textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 16px;
    color: #333;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    transition: all 0.2s ease;
    outline: none;
    line-height: 1.5;
}

.scf-field input:focus,
.scf-field textarea:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.scf-field input::placeholder,
.scf-field textarea::placeholder {
    color: #9ca3af;
}

.scf-field textarea {
    resize: vertical;
    min-height: 120px;
}

/* ── Name Field Grid ── */
.scf-name-group input {
    margin-bottom: 0;
}

/* ── Address Fields ── */
.scf-field input[name="contact_address_line2"],
.scf-field input[name="contact_city"],
.scf-field input[name="contact_state"],
.scf-field input[name="contact_zip"] {
    border: 1px solid #d0d5dd;
}

/* ── Honeypot (completely hidden) ── */
.scf-honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
    height: 0;
    overflow: hidden;
}

/* ── Submit Button ── */
.scf-submit {
    margin-top: 24px;
}

.scf-button,
input[type="submit"].scf-button {
    width: 100%;
    background: var(--blue, #537d94);
    color: white;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(83, 125, 148, 0.2);
}

.scf-button:hover,
input[type="submit"].scf-button:hover {
    background: var(--deep-red, #944d44);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(148, 77, 68, 0.3);
}

.scf-button:active,
input[type="submit"].scf-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(83, 125, 148, 0.2);
}

.scf-button:disabled,
input[type="submit"].scf-button:disabled {
    background: var(--gray, #5a6670);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

/* ── GDPR Checkbox ── */
.scf-field input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    cursor: pointer;
    margin: 0;
}

.scf-field label:has(input[type="checkbox"]) {
    font-weight: 400;
    color: #4b5563;
    font-size: 14px;
    cursor: pointer;
}

.scf-field label:has(input[type="checkbox"]):hover {
    color: #1f2937;
}

/* ── GDPR Checkbox Label ── */
.scf-checkbox-label {
    display: block !important;
    margin-bottom: 8px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    color: #1a1a1a !important;
}

/* ── Success/Error Messages ── */
.scf-message {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.6;
    animation: slideInDown 0.3s ease-out;
}

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

.scf-success {
    background: #d1f4e0;
    color: #0f5132;
    border: 1px solid #a3e1c1;
}

.scf-success::before {
    content: '✓ ';
    font-weight: bold;
}

.scf-error {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

.scf-error::before {
    content: '⚠ ';
    font-weight: bold;
}

/* ── Validation Error States ── */
.scf-error-field {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

.scf-field-error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 6px;
    font-weight: 500;
}

/* ── Character Counter ── */
.scf-char-counter {
    font-size: 13px;
    color: #6b7280;
    text-align: right;
    margin-top: 6px;
}

.scf-over-limit {
    color: #dc3545;
    font-weight: 600;
}

/* ── Loading Spinner ── */
.scf-spinner {
    display: inline-block;
    margin-left: 10px;
    animation: spin 1s linear infinite;
}

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

/* ── Responsive Design ── */
@media (max-width: 768px) {
    .scf-contact-form {
        padding: 0 16px;
    }
    
    .scf-field {
        margin-bottom: 16px;
    }
    
    .scf-field label {
        font-size: 15px;
    }
    
    .scf-field input,
    .scf-field textarea {
        font-size: 16px;
        padding: 12px 14px;
    }
    
    .scf-button,
    input[type="submit"].scf-button {
        width: 100%;
        padding: 14px 20px;
    }
    
    .scf-name-group > div {
        grid-template-columns: 1fr !important;
    }
}

/* ── Accessibility ── */
.scf-field input:focus-visible,
.scf-field textarea:focus-visible {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

.scf-button:focus-visible {
    outline: 2px solid #4a90e2;
    outline-offset: 3px;
}

/* ── Override WordPress/Theme Defaults ── */
.scf-contact-form input[type="text"],
.scf-contact-form input[type="email"],
.scf-contact-form input[type="tel"],
.scf-contact-form input[type="number"],
.scf-contact-form textarea,
.scf-contact-form input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.scf-contact-form input[type="checkbox"] {
    -webkit-appearance: checkbox;
    -moz-appearance: checkbox;
    appearance: checkbox;
}

/* ── Math Security Question Field ── */
.scf-field input[name="math_answer"] {
    width: 120px;
    max-width: 100%;
}

/* ── Print Styles ── */
@media print {
    .scf-contact-form {
        display: none;
    }
}