/* CKForms Public Styles */
:root {
    --ckf-primary: #4F46E5;
    --ckf-primary-hover: #4338CA;
    --ckf-danger: #EF4444;
    --ckf-success: #10B981;
    --ckf-gray-100: #F3F4F6;
    --ckf-gray-200: #E5E7EB;
    --ckf-gray-300: #D1D5DB;
    --ckf-gray-500: #6B7280;
    --ckf-gray-700: #374151;
    --ckf-gray-900: #111827;
    --ckf-radius: 6px;
    --ckf-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

.ckforms-form-wrapper {
    max-width: 720px;
    margin: 0 auto;
    font-family: var(--ckf-font);
}
.ckforms-form {
    padding: 0;
}

/* Fields */
.ckforms-field {
    margin-bottom: 18px;
}
.ckforms-label {
    margin-bottom: 5px;
}
.ckforms-label label {
    font-size: 14px;
    font-weight: 500;
    color: var(--ckf-gray-700);
    display: block;
}
.ckforms-required { color: var(--ckf-danger); margin-left: 2px; }
.ckforms-sub-label {
    font-size: 12px;
    color: var(--ckf-gray-500);
    margin-top: 3px;
    display: block;
}

/* Inputs */
.ckforms-input,
.ckforms-select,
.ckforms-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--ckf-gray-300);
    border-radius: var(--ckf-radius);
    font-size: 14px;
    font-family: var(--ckf-font);
    color: var(--ckf-gray-900);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.ckforms-input:focus,
.ckforms-select:focus,
.ckforms-textarea:focus {
    outline: none;
    border-color: var(--ckf-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.ckforms-input.ckforms-error,
.ckforms-textarea.ckforms-error {
    border-color: var(--ckf-danger);
}
.ckforms-textarea {
    resize: vertical;
    min-height: 80px;
}
.ckforms-confirm-field {
    margin-top: 8px;
}

/* Label Placements */
.ckforms-label-left .ckforms-field {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 10px;
    align-items: start;
}
.ckforms-label-left .ckforms-label { text-align: right; padding-top: 10px; }
.ckforms-label-left .ckforms-help-message,
.ckforms-label-left .ckforms-field-error { grid-column: 2; }

.ckforms-label-right .ckforms-field {
    display: grid;
    grid-template-columns: 1fr 140px;
    gap: 10px;
    align-items: start;
}
.ckforms-label-right .ckforms-label { order: 2; padding-top: 10px; }

/* Name & Address */
.ckforms-name-fields {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.ckforms-name-fields > div { flex: 1; min-width: 120px; }
.ckforms-name-prefix { max-width: 100px; }

.ckforms-address-fields { display: grid; gap: 10px; }
.ckforms-address-address_1,
.ckforms-address-address_2 { grid-column: 1 / -1; }
.ckforms-address-fields {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Options (Radio/Checkbox) */
.ckforms-options { margin: 4px 0; }
.ckforms-options-vertical .ckforms-option { display: block; margin: 6px 0; }
.ckforms-options-horizontal { display: flex; flex-wrap: wrap; gap: 15px; }
.ckforms-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    color: var(--ckf-gray-700);
}
.ckforms-option input[type="radio"],
.ckforms-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--ckf-primary);
}

/* Multiple Choice */
.ckforms-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.ckforms-choices-vertical { flex-direction: column; }
.ckforms-choice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 2px solid var(--ckf-gray-200);
    border-radius: var(--ckf-radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}
.ckforms-choice:hover { border-color: var(--ckf-primary); }
.ckforms-choice input:checked ~ span { color: var(--ckf-primary); font-weight: 500; }
.ckforms-choice input { display: none; }
.ckforms-choice input:checked + img + span,
.ckforms-choice input:checked + span { color: var(--ckf-primary); }
.ckforms-choices-images .ckforms-choice {
    flex-direction: column;
    text-align: center;
    width: 140px;
    padding: 12px;
}
.ckforms-choices-images .ckforms-choice img {
    max-width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 6px;
}
.ckforms-choice input:checked ~ * {
    color: var(--ckf-primary);
}
.ckforms-choice:has(input:checked) {
    border-color: var(--ckf-primary);
    background: rgba(79, 70, 229, 0.03);
}

/* File Upload */
.ckforms-file-upload { position: relative; }
.ckforms-file-input {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.ckforms-file-upload-area {
    border: 2px dashed var(--ckf-gray-300);
    border-radius: var(--ckf-radius);
    padding: 25px;
    text-align: center;
    transition: all 0.2s;
}
.ckforms-file-upload-area:hover {
    border-color: var(--ckf-primary);
    background: rgba(79, 70, 229, 0.02);
}
.ckforms-file-upload-area .dashicons {
    font-size: 32px;
    color: var(--ckf-gray-500);
    margin-bottom: 8px;
}
.ckforms-file-upload-area p { margin: 0 0 4px; font-size: 14px; color: var(--ckf-gray-700); }
.ckforms-file-upload-area small { color: var(--ckf-gray-500); }
.ckforms-file-list { margin-top: 8px; }
.ckforms-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: var(--ckf-gray-100);
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 4px;
}
.ckforms-file-remove {
    background: none;
    border: none;
    color: var(--ckf-danger);
    cursor: pointer;
    font-size: 16px;
}

/* Rating */
.ckforms-rating { display: flex; gap: 4px; }
.ckforms-star {
    font-size: 28px;
    color: var(--ckf-gray-300);
    cursor: pointer;
    transition: color 0.15s;
    line-height: 1;
}
.ckforms-star:hover,
.ckforms-star.active { color: #F59E0B; }

/* Range Slider */
.ckforms-range-slider { display: flex; align-items: center; gap: 10px; }
.ckforms-range {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: var(--ckf-gray-200);
    border-radius: 3px;
    outline: none;
}
.ckforms-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--ckf-primary);
    cursor: pointer;
}
.ckforms-range-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    color: var(--ckf-primary);
}

/* NPS */
.ckforms-nps-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--ckf-gray-500); margin-bottom: 6px; }
.ckforms-nps-scores { display: flex; gap: 4px; }
.ckforms-nps-score {
    cursor: pointer;
}
.ckforms-nps-score span {
    display: block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    border: 2px solid var(--ckf-gray-200);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.15s;
}
.ckforms-nps-score:hover span,
.ckforms-nps-score input:checked + span {
    border-color: var(--ckf-primary);
    background: var(--ckf-primary);
    color: #fff;
}
.ckforms-nps-score input { display: none; }

/* Section Break */
.ckforms-section-break h4 { margin: 0 0 4px; font-size: 16px; color: var(--ckf-gray-900); }
.ckforms-section-break p { margin: 0 0 8px; font-size: 13px; color: var(--ckf-gray-500); }
.ckforms-section-break hr { border: none; border-top: 1px solid var(--ckf-gray-200); }

/* Color Picker */
.ckforms-color-picker {
    width: 60px;
    height: 40px;
    padding: 2px;
    border: 1px solid var(--ckf-gray-300);
    border-radius: var(--ckf-radius);
    cursor: pointer;
}

/* Grid */
.ckforms-grid { width: 100%; border-collapse: collapse; }
.ckforms-grid th, .ckforms-grid td {
    padding: 8px 12px;
    border: 1px solid var(--ckf-gray-200);
    text-align: center;
    font-size: 13px;
}
.ckforms-grid th { background: var(--ckf-gray-100); font-weight: 500; }
.ckforms-grid td:first-child { text-align: left; font-weight: 500; }

/* Container Columns */
.ckforms-container { display: flex; gap: 15px; }
.ckforms-column { flex: 1; }

/* Payment */
.ckforms-payment-item { padding: 12px; background: var(--ckf-gray-100); border-radius: var(--ckf-radius); }
.ckforms-payment-price { font-size: 20px; font-weight: 700; color: var(--ckf-primary); }
.ckforms-payment-options .ckforms-option { padding: 10px; border: 1px solid var(--ckf-gray-200); border-radius: var(--ckf-radius); margin: 4px 0; }
.ckforms-custom-payment { display: flex; align-items: center; }
.ckforms-currency-symbol {
    padding: 10px 14px;
    background: var(--ckf-gray-100);
    border: 1px solid var(--ckf-gray-300);
    border-right: none;
    border-radius: var(--ckf-radius) 0 0 var(--ckf-radius);
    font-weight: 600;
    color: var(--ckf-gray-700);
}
.ckforms-custom-payment .ckforms-input { border-radius: 0 var(--ckf-radius) var(--ckf-radius) 0; }
.ckforms-payment-summary {
    padding: 16px;
    background: var(--ckf-gray-100);
    border-radius: var(--ckf-radius);
    border: 1px solid var(--ckf-gray-200);
}
.ckforms-subscription-plans .ckforms-plan { margin: 4px 0; }
.ckforms-coupon-field { display: flex; gap: 8px; }
.ckforms-coupon-field .ckforms-input { flex: 1; }
.ckforms-apply-coupon {
    padding: 10px 20px;
    background: var(--ckf-gray-100);
    border: 1px solid var(--ckf-gray-300);
    border-radius: var(--ckf-radius);
    cursor: pointer;
    font-weight: 500;
}
.ckforms-apply-coupon:hover { background: var(--ckf-gray-200); }

/* T&C */
.ckforms-tc-text {
    max-height: 150px;
    overflow-y: auto;
    padding: 12px;
    background: var(--ckf-gray-100);
    border-radius: var(--ckf-radius);
    font-size: 13px;
    margin-bottom: 8px;
}

/* Repeat Fields */
.ckforms-repeat-container { border: 1px solid var(--ckf-gray-200); border-radius: var(--ckf-radius); padding: 12px; }
.ckforms-repeat-row { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--ckf-gray-100); }
.ckforms-repeat-add {
    display: block;
    width: 100%;
    padding: 8px;
    border: 1px dashed var(--ckf-gray-300);
    border-radius: var(--ckf-radius);
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--ckf-gray-500);
}
.ckforms-repeat-add:hover { border-color: var(--ckf-primary); color: var(--ckf-primary); }

/* Multi-step */
.ckforms-progress-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 15px 0;
}
.ckforms-progress-step {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ckf-gray-200);
    color: var(--ckf-gray-500);
    font-weight: 600;
    font-size: 14px;
    position: relative;
}
.ckforms-progress-step.active {
    background: var(--ckf-primary);
    color: #fff;
}
.ckforms-progress-step.completed { background: var(--ckf-success); color: #fff; }
.ckforms-step { display: none; }
.ckforms-step.ckforms-step-active { display: block; }
.ckforms-step-title { font-size: 18px; margin: 0 0 4px; color: var(--ckf-gray-900); }
.ckforms-step-subtitle { margin: 0 0 15px; color: var(--ckf-gray-500); font-size: 14px; }
.ckforms-step-nav { display: flex; justify-content: space-between; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--ckf-gray-200); }
.ckforms-btn-prev,
.ckforms-btn-next {
    padding: 10px 24px;
    border: 1px solid var(--ckf-gray-300);
    border-radius: var(--ckf-radius);
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}
.ckforms-btn-next {
    background: var(--ckf-primary);
    color: #fff;
    border-color: var(--ckf-primary);
}
.ckforms-btn-prev:hover { background: var(--ckf-gray-100); }
.ckforms-btn-next:hover { background: var(--ckf-primary-hover); }

/* Submit Button */
.ckforms-submit-wrap { margin-top: 20px; }
.ckforms-submit-btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--ckf-primary);
    color: #fff;
    border: none;
    border-radius: var(--ckf-radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-family: var(--ckf-font);
}
.ckforms-submit-btn:hover { background: var(--ckf-primary-hover); }
.ckforms-submit-btn:disabled { opacity: 0.7; cursor: not-allowed; }

/* Response Messages */
.ckforms-response {
    padding: 14px 18px;
    border-radius: var(--ckf-radius);
    margin-top: 15px;
    font-size: 14px;
}
.ckforms-response.ckforms-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #6EE7B7;
}
.ckforms-response.ckforms-error-msg {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

/* Help & Error Messages */
.ckforms-help-message {
    font-size: 12px;
    color: var(--ckf-gray-500);
    margin-top: 4px;
}
.ckforms-field-error {
    font-size: 12px;
    color: var(--ckf-danger);
    margin-top: 4px;
}

/* Notice */
.ckforms-notice {
    padding: 14px 18px;
    background: var(--ckf-gray-100);
    border: 1px solid var(--ckf-gray-200);
    border-radius: var(--ckf-radius);
    color: var(--ckf-gray-700);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 600px) {
    .ckforms-name-fields { flex-direction: column; }
    .ckforms-address-fields { grid-template-columns: 1fr; }
    .ckforms-container { flex-direction: column; }
    .ckforms-nps-scores { flex-wrap: wrap; }
    .ckforms-nps-score span { width: 30px; height: 30px; line-height: 30px; font-size: 12px; }
    .ckforms-label-left .ckforms-field,
    .ckforms-label-right .ckforms-field {
        grid-template-columns: 1fr;
    }
    .ckforms-label-left .ckforms-label,
    .ckforms-label-right .ckforms-label { text-align: left; order: unset; }
}
