/* WP Smart Forms – Frontend Styles */

#wsf-form-wrap {
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

#wsf-form-wrap *,
#wsf-form-wrap *::before,
#wsf-form-wrap *::after {
    box-sizing: border-box;
}

.wsf-form {
    width: 100%;
}

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

.wsf-field-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.wsf-field-group label .wsf-required {
    color: #e53e3e;
    margin-left: 3px;
}

/* ── Inputs ── */
.wsf-field-group input[type="text"],
.wsf-field-group input[type="email"],
.wsf-field-group input[type="tel"],
.wsf-field-group input[type="number"],
.wsf-field-group input[type="url"],
.wsf-field-group input[type="password"],
.wsf-field-group input[type="date"],
.wsf-field-group input[type="time"],
.wsf-field-group textarea,
.wsf-field-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.wsf-field-group input:focus,
.wsf-field-group textarea:focus,
.wsf-field-group select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.wsf-field-group textarea {
    resize: vertical;
    min-height: 100px;
}

.wsf-field-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* ── Radio & Checkbox ── */
.wsf-radio-group,
.wsf-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.wsf-radio-option,
.wsf-checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
}

.wsf-radio-option input[type="radio"],
.wsf-checkbox-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4f46e5;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Range slider ── */
.wsf-range-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wsf-range-wrap input[type="range"] {
    flex: 1;
    accent-color: #4f46e5;
    height: 4px;
    cursor: pointer;
}

.wsf-range-value {
    min-width: 36px;
    text-align: center;
    font-weight: 700;
    color: #4f46e5;
    font-size: 14px;
    background: #eef2ff;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ── Star rating ── */
.wsf-rating-wrap {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.wsf-rating-wrap input[type="radio"] {
    display: none;
}

.wsf-rating-wrap label {
    font-size: 28px;
    cursor: pointer;
    color: #d1d5db;
    transition: color 0.15s;
    margin-bottom: 0;
    font-weight: normal;
    line-height: 1;
}

.wsf-rating-wrap label:hover,
.wsf-rating-wrap label:hover ~ label,
.wsf-rating-wrap input:checked ~ label {
    color: #f59e0b;
}

.wsf-rating-wrap {
    direction: rtl;
}

.wsf-rating-wrap label:hover,
.wsf-rating-wrap label:hover ~ label {
    color: #f59e0b;
}

/* ── File upload ── */
.wsf-file-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 2px dashed #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    font-size: 13px;
    transition: border-color 0.2s, background 0.2s;
}

.wsf-file-label:hover {
    border-color: #4f46e5;
    background: #f5f3ff;
    color: #4f46e5;
}

.wsf-file-label svg {
    flex-shrink: 0;
}

.wsf-file-name {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    display: block;
}

input[type="file"].wsf-hidden-file {
    display: none;
}

/* ── Divider ── */
.wsf-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 20px 0;
}

/* ── Heading ── */
.wsf-heading {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 8px 0 16px;
}

/* ── GDPR ── */
.wsf-gdpr-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.wsf-gdpr-wrap input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #4f46e5;
    flex-shrink: 0;
    margin-top: 2px;
}

.wsf-gdpr-wrap span {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

/* ── Submit button ── */
.wsf-submit-wrap {
    margin-top: 24px;
}

.wsf-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    outline: none;
}

.wsf-submit-btn:hover {
    background: #4338ca;
}

.wsf-submit-btn:active {
    transform: scale(0.98);
}

.wsf-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wsf-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wsf-spin 0.7s linear infinite;
}

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

/* ── Validation messages ── */
.wsf-field-error {
    color: #e53e3e;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.wsf-field-group.wsf-has-error input,
.wsf-field-group.wsf-has-error textarea,
.wsf-field-group.wsf-has-error select {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.wsf-field-group.wsf-has-error .wsf-field-error {
    display: block;
}

/* ── Notices ── */
.wsf-notice {
    padding: 14px 18px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

.wsf-notice.wsf-success {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #065f46;
    display: block;
}

.wsf-notice.wsf-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    display: block;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .wsf-submit-btn {
        width: 100%;
        justify-content: center;
    }

    .wsf-rating-wrap label {
        font-size: 24px;
    }
}

/* ── Field description / helper text ── */
.wsf-field-desc {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 5px;
    line-height: 1.4;
}
