/* CLV Forms — Frontend Styles */
.clvf-form-wrap { max-width: 100%; margin: 0 0 2em; font-family: inherit; }
.clvf-form { clear: both; }
.clvf-fields {}
.clvf-field { margin-bottom: 16px; }
.clvf-field-label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px; color: #333; }
.clvf-required { color: #e53e3e; }
.clvf-field-description { font-size: 0.85em; color: #666; margin-top: 4px; }
.clvf-field-input-wrap {}

/* Inputs */
.clvf-input {
    width: 100%; max-width: 100%; padding: 10px 12px;
    border: 1px solid #ddd; border-radius: 4px;
    font-size: 14px; line-height: 1.5; color: #333;
    background: #fff; box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.clvf-input:focus { border-color: #0073aa; outline: none; box-shadow: 0 0 0 3px rgba(0,115,170,0.1); }
.clvf-textarea { min-height: 80px; resize: vertical; }
.clvf-size-medium { max-width: 60%; }
.clvf-size-small { max-width: 30%; }

/* Select */
.clvf-select { cursor: pointer; }

/* Checkbox & Radio groups */
.clvf-checkbox-group, .clvf-radio-group { display: flex; flex-direction: column; gap: 6px; }
.clvf-checkbox-label, .clvf-radio-label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; }
.clvf-checkbox-label input, .clvf-radio-label input { margin: 0; }

/* Rating */
.clvf-rating-group { display: inline-flex; flex-direction: row-reverse; }
.clvf-rating-input { display: none; }
.clvf-rating-star { font-size: 1.8em; cursor: pointer; color: #ddd; transition: color 0.15s; }
.clvf-rating-input:checked ~ .clvf-rating-star, .clvf-rating-star:hover, .clvf-rating-star:hover ~ .clvf-rating-star { color: #f5a623; }
.clvf-rating-group:hover .clvf-rating-star { color: #f5a623; }

/* Address */
.clvf-address-group { display: flex; flex-direction: column; gap: 8px; }
.clvf-address-row { display: flex; gap: 8px; }
.clvf-address-row .clvf-input { flex: 1; }

/* Phone */
.clvf-phone-field { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.clvf-phone-country { max-width: 200px; }
.clvf-phone-number { flex: 1; min-width: 150px; }

/* File upload */
.clvf-file-upload { padding: 8px; }
.clvf-file-upload-info { font-size: 0.8em; color: #888; margin-top: 4px; }

/* Consent */
.clvf-consent-wrap { }
.clvf-consent-label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.clvf-consent-checkbox { margin-top: 4px; }

/* Signature */
.clvf-signature-pad-wrap { }
.clvf-signature-canvas { border: 2px solid #ddd; border-radius: 4px; background: #fff; cursor: crosshair; max-width: 100%; touch-action: none; }
.clvf-signature-clear { margin-top: 4px; font-size: 0.85em; }
.clvf-signature-disclaimer { font-size: 0.8em; color: #888; margin-top: 4px; }

/* Repeater */
.clvf-repeater-wrap { }
.clvf-repeater-rows { }
.clvf-repeater-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.clvf-repeater-row .clvf-input { flex: 1; }
.clvf-repeater-remove { background: #d9534f; color: #fff; border: none; border-radius: 50%; width: 28px; height: 28px; cursor: pointer; font-size: 16px; line-height: 1; flex-shrink: 0; }
.clvf-repeater-add { margin-top: 4px; }

/* Divider */
.clvf-divider { border-top: 1px solid #ddd; margin: 20px 0; padding-top: 12px; }
.clvf-divider-title { font-size: 1.2em; font-weight: 700; margin: 0 0 4px; color: #333; }
.clvf-divider-desc { color: #666; font-size: 0.9em; margin: 0 0 8px; }

/* Page break / multi-page */
.clvf-page-break { display: none; }
.clvf-page-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.clvf-page-indicator { font-size: 0.85em; color: #666; }

/* Submit */
.clvf-submit-wrap { margin-top: 20px; }
.clvf-submit-button {
    background: #0073aa; color: #fff; border: none; border-radius: 4px;
    padding: 12px 32px; font-size: 15px; cursor: pointer;
    transition: background 0.2s; display: inline-flex; align-items: center; gap: 8px;
}
.clvf-submit-button:hover { background: #005a87; }
.clvf-submit-spinner {
    display: inline-block; width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
    border-radius: 50%; animation: clvf-spin 0.8s linear infinite;
}
@keyframes clvf-spin { to { transform: rotate(360deg); } }

/* Errors */
.clvf-form-errors { background: #fee; border: 1px solid #fcc; border-radius: 4px; padding: 12px; margin-bottom: 16px; }
.clvf-form-errors ul { margin: 0; padding-left: 20px; color: #c33; }

/* Success message */
.clvf-form-success { background: #d4edda; border: 1px solid #c3e6cb; border-radius: 4px; padding: 16px; margin-bottom: 16px; color: #155724; }

/* Honeypot */
.clvf-honeypot { position: absolute !important; left: -9999px !important; }

/* Locked form */
.clvf-form-locked { background: #f9f9f9; border: 1px solid #e0e0e0; border-radius: 4px; padding: 24px; text-align: center; }
.clvf-lock-form { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.clvf-lock-form input { padding: 8px; border: 1px solid #ddd; border-radius: 4px; }

/* Layout: Two columns */
.clvf-layout-two-column .clvf-field { width: 48%; display: inline-block; vertical-align: top; margin-right: 2%; }

/* Label positions */
.clvf-label-left .clvf-field-label { display: inline-block; width: 30%; vertical-align: middle; margin-bottom: 0; }
.clvf-label-left .clvf-field-input-wrap { display: inline-block; width: 68%; vertical-align: middle; }
.clvf-label-hidden .clvf-field-label { display: none; }

/* Conversational forms */
.clvf-conversational-wrap { max-width: 600px; margin: 0 auto; }
.clvf-conv-progress { height: 4px; background: #e0e0e0; border-radius: 2px; margin-bottom: 24px; overflow: hidden; }
.clvf-conv-progress-bar { height: 100%; background: #0073aa; transition: width 0.3s ease; }
.clvf-conv-question { margin-bottom: 24px; }
.clvf-conv-question-label h3 { margin: 0 0 12px; font-size: 1.3em; }
.clvf-conv-question-nav { display: flex; justify-content: space-between; margin-top: 16px; }

/* Survey results */
.clvf-survey-results { }
.clvf-survey-field { margin-bottom: 24px; }
.clvf-survey-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.clvf-survey-label { width: 150px; font-size: 0.9em; }
.clvf-survey-bar-track { flex: 1; height: 20px; background: #eee; border-radius: 10px; overflow: hidden; }
.clvf-survey-bar-fill { height: 100%; background: #0073aa; transition: width 0.5s; }
.clvf-survey-count { font-size: 0.85em; color: #666; min-width: 80px; }

/* Form page (distraction-free) */
.clvf-form-page-wrap { }

/* Responsive */
@media (max-width: 768px) {
    .clvf-layout-two-column .clvf-field { width: 100%; margin-right: 0; }
    .clvf-address-row { flex-direction: column; }
    .clvf-phone-field { flex-direction: column; align-items: stretch; }
    .clvf-label-left .clvf-field-label, .clvf-label-left .clvf-field-input-wrap { display: block; width: 100%; }
    .clvf-input { font-size: 16px; } /* Prevent iOS zoom */
}
