/* Advanced Form Builder — Frontend Styles */

.afb-form-wrap { max-width: 680px; margin: 0 auto; font-family: inherit; }

/* Notices */
.afb-notice { padding: 12px 16px; border-radius: 6px; margin-bottom: 18px; font-size: 14px; line-height: 1.5; }
.afb-success { background: #d4edda; border: 1px solid #c3e6cb; color: #155724; }
.afb-error-msg { background: #f8d7da; border: 1px solid #f5c6cb; color: #721c24; }

/* Field wrap */
.afb-field-wrap { margin-bottom: 20px; }
.afb-label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: #333; }
.afb-required { color: #e53e3e; margin-left: 2px; }
.afb-field-desc { font-size: 12px; color: #666; margin: 4px 0 0; }
.afb-field-error { display: block; color: #e53e3e; font-size: 12px; margin-top: 4px; }

/* Inputs */
.afb-input,
.afb-select,
.afb-textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}
.afb-input:focus,
.afb-select:focus,
.afb-textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
.afb-input.afb-has-error,
.afb-select.afb-has-error,
.afb-textarea.afb-has-error {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229,62,62,.15);
}
.afb-textarea { resize: vertical; min-height: 120px; }
.afb-select    { appearance: none; 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='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

/* Radio & Checkbox */
.afb-radio-group, .afb-checkbox-group { display: flex; flex-direction: column; gap: 8px; }
.afb-radio-label, .afb-checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #333; cursor: pointer; }
.afb-radio-label input, .afb-checkbox-label input { width: 16px; height: 16px; cursor: pointer; accent-color: #4f46e5; }

/* Section break */
.afb-section-break { margin: 28px 0 20px; }
.afb-section-title { font-size: 16px; font-weight: 700; color: #111; margin: 0 0 4px; }
.afb-section-desc  { font-size: 13px; color: #666; margin: 0 0 8px; }
.afb-section-break hr { border: none; border-top: 2px solid #e5e7eb; }

/* HTML block */
.afb-html-block { font-size: 14px; color: #444; line-height: 1.6; }

/* Submit */
.afb-submit-row { margin-top: 24px; }
.afb-submit-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px; font-size: 15px; font-weight: 600;
    color: #fff; background: #4f46e5; border: none;
    border-radius: 6px; cursor: pointer; font-family: inherit;
    transition: background .15s, transform .1s, box-shadow .15s;
    box-shadow: 0 2px 6px rgba(79,70,229,.35);
}
.afb-submit-btn:hover   { background: #4338ca; box-shadow: 0 4px 12px rgba(79,70,229,.4); }
.afb-submit-btn:active  { transform: translateY(1px); }
.afb-submit-btn:disabled { opacity: .7; cursor: not-allowed; transform: none; }

/* Loading spinner */
@keyframes afb-spin { to { transform: rotate(360deg); } }
.afb-btn-spinner::before {
    content: '';
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: afb-spin .7s linear infinite;
}

/* Error */
.afb-error { color: #e53e3e; font-style: italic; }

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