/**
 * Contact Form Widget — Stylesheet
 * File: assets/css/contact-form.css
 *
 * Enqueue handle: ce-contact-form-css
 * Registered in: your main plugin file or helpers
 */

/* ══════════════════════════════════════════════════════════════
   FORM WRAPPER
   ══════════════════════════════════════════════════════════════ */
.cf-form-wrap {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    font-family: inherit;
}

.cf-form-wrap *,
.cf-form-wrap *::before,
.cf-form-wrap *::after {
    box-sizing: border-box;
}

/* ══════════════════════════════════════════════════════════════
   FORM HEADER (Title + Subtitle)
   ══════════════════════════════════════════════════════════════ */
.cf-header {
    margin-bottom: 24px;
}

.cf-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
    line-height: 1.3;
}

.cf-subtitle {
    font-size: 14px;
    color: #888;
    margin: 0;
    line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════
   LAYOUT — Two Column Row
   ══════════════════════════════════════════════════════════════ */
.cf-layout-twocol .cf-row {
    display: flex;
    gap: 20px;
}

.cf-layout-twocol .cf-col {
    flex: 1;
    min-width: 0;
}

/* ══════════════════════════════════════════════════════════════
   FIELD GROUPS
   ══════════════════════════════════════════════════════════════ */
.cf-field-group {
    margin-bottom: 20px;
}

/* ── Labels ── */
.cf-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.4;
}

.cf-required {
    color: #e74c3c;
    margin-left: 3px;
}

/* ── Base Input / Select / Textarea ── */
.cf-input,
.cf-select,
.cf-textarea {
    display: block;
    width: 100%;
    font-size: 14px;
    color: #333;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 12px 16px;
    line-height: 1.5;
    font-family: inherit;
    transition: border-color 0.2s ease, background 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

/* ── Select custom arrow ── */
.cf-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

/* ── Focus state ── */
.cf-input:focus,
.cf-select:focus,
.cf-textarea:focus {
    outline: none;
    border-color: #b5865a;
    background: #fafafa;
}

/* ── Textarea ── */
.cf-textarea {
    resize: vertical;
    min-height: 120px;
}

/* ══════════════════════════════════════════════════════════════
   CHECKBOX
   ══════════════════════════════════════════════════════════════ */
.cf-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #444;
    line-height: 1.4;
}

.cf-checkbox {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #b5865a;
}

/* ══════════════════════════════════════════════════════════════
   FIELD VALIDATION ERROR
   ══════════════════════════════════════════════════════════════ */
.cf-field-error {
    font-size: 12px;
    color: #e74c3c;
    margin-top: 5px;
    min-height: 16px;
    line-height: 1.3;
}

.cf-has-error .cf-input,
.cf-has-error .cf-select,
.cf-has-error .cf-textarea {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.10);
}

/* ══════════════════════════════════════════════════════════════
   SUBMIT BUTTON
   ══════════════════════════════════════════════════════════════ */
.cf-btn-wrap {
    margin-top: 8px;
}

.cf-submit-btn {
    display: inline-block;
    padding: 14px 36px;
    background: #b5865a;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.cf-submit-btn:hover {
    background: #9a7048;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(181, 134, 90, 0.3);
}

.cf-submit-btn:active {
    transform: none;
    box-shadow: none;
}

.cf-submit-btn:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

/* Full-width button when alignment is set to full */
.cf-btn-wrap.cf-btn-full .cf-submit-btn {
    display: block;
    width: 100%;
    text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   STATUS MESSAGES (Success / Error)
   ══════════════════════════════════════════════════════════════ */
.cf-msg {
    display: none;
    padding: 14px 18px;
    border-radius: 5px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.cf-msg-success {
    background: #d4edda;
    color: #1a7a4a;
    border: 1px solid #c3e6cb;
}

.cf-msg-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ══════════════════════════════════════════════════════════════
   LOADING SPINNER (shown on submit)
   ══════════════════════════════════════════════════════════════ */
.cf-submit-btn.cf-loading {
    position: relative;
    padding-left: 42px;
}

.cf-submit-btn.cf-loading::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cf-spin 0.7s linear infinite;
}

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

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 580px) {
    .cf-layout-twocol .cf-row {
        flex-direction: column;
        gap: 0;
    }

    .cf-submit-btn {
        display: block;
        width: 100%;
        text-align: center;
    }
}
