/* =========================================================
   Smart Form Builder – Frontend Form Styles
   Clean, modern, theme-compatible form design
========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

.sfb-form-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    max-width: 680px;
    margin: 32px auto;
}

.sfb-form-description {
    color: #6b7280;
    font-size: 15px;
    margin-bottom: 28px;
    line-height: 1.6;
}

/* --- Form Layout --- */
.sfb-form {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
}

/* --- Field Wrap --- */
.sfb-field-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sfb-form-submit {
    grid-column: span 12;
}

.sfb-width-100 { grid-column: span 12; }
.sfb-width-75  { grid-column: span 9; }
.sfb-width-50  { grid-column: span 6; }
.sfb-width-25  { grid-column: span 3; }

.sfb-label {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.sfb-required {
    color: #ef4444;
    margin-left: 2px;
}

/* --- Inputs --- */
.sfb-input,
.sfb-textarea,
.sfb-select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: #1f2937;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.sfb-input:focus,
.sfb-textarea:focus,
.sfb-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
    outline: none;
}

.sfb-input::placeholder,
.sfb-textarea::placeholder {
    color: #9ca3af;
}

.sfb-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.sfb-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 fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

/* --- Radio / Checkbox groups --- */
.sfb-radio-group,
.sfb-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.sfb-radio-label input[type="radio"],
.sfb-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
    cursor: pointer;
    flex-shrink: 0;
}

/* --- File Upload Zone --- */
.sfb-file-zone {
    position: relative;
    border: 2px dashed #c4b5fd;
    background: #faf5ff;
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.sfb-file-zone:hover,
.sfb-file-zone.sfb-drag-over {
    background: #ede9fe;
    border-color: #7c3aed;
}

.sfb-file-icon {
    font-size: 32px;
    line-height: 1;
}

.sfb-file-text {
    font-size: 15px;
    font-weight: 600;
    color: #5b21b6;
}

.sfb-file-types {
    font-size: 12px;
    color: #7c3aed;
}

.sfb-file-name {
    font-size: 13px;
    color: #374151;
    margin-top: 4px;
    font-style: italic;
}

.sfb-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* --- Error States --- */
.sfb-field-error .sfb-input,
.sfb-field-error .sfb-textarea,
.sfb-field-error .sfb-select,
.sfb-field-error .sfb-file-zone {
    border-color: #ef4444;
}

.sfb-field-error-msg {
    font-size: 12px;
    color: #ef4444;
    font-weight: 500;
}

.sfb-error-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 16px 20px;
    color: #dc2626;
    font-size: 14px;
}

.sfb-error-box ul {
    margin: 0;
    padding-left: 20px;
}

/* --- Success Message --- */
.sfb-success-message {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1px solid #6ee7b7;
    border-radius: 12px;
    padding: 20px 24px;
    color: #065f46;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 20px;
    text-align: center;
}

/* --- Submit Button --- */
.sfb-form-submit {
    margin-top: 8px;
}

.sfb-btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}

.sfb-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99,102,241,0.45);
}

.sfb-btn-submit:active {
    transform: translateY(0);
    opacity: 0.9;
}

.sfb-btn-icon {
    font-size: 18px;
    transition: transform 0.2s;
}

.sfb-btn-submit:hover .sfb-btn-icon {
    transform: translateX(4px);
}

/* --- Error generic --- */
.sfb-error {
    color: #dc2626;
    font-size: 14px;
}

/* --- WhatsApp CTA --- */
.sfb-whatsapp-cta {
    margin-top: 20px;
    text-align: center;
}

.sfb-whatsapp-hint {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 14px;
}

.sfb-btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff;
    text-decoration: none;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 14px rgba(37,211,102,0.4);
    animation: sfb-pulse-wa 2s ease-in-out infinite;
}

.sfb-btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(37,211,102,0.5);
    color: #fff;
    text-decoration: none;
}

.sfb-btn-whatsapp:active {
    transform: translateY(0);
}

.sfb-btn-whatsapp svg {
    flex-shrink: 0;
}

@keyframes sfb-pulse-wa {
    0%, 100% { box-shadow: 0 4px 14px rgba(37,211,102,0.4); }
    50%       { box-shadow: 0 4px 22px rgba(37,211,102,0.65); }
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .sfb-form-container {
        margin: 16px auto;
    }

    .sfb-width-75,
    .sfb-width-50,
    .sfb-width-25 {
        grid-column: span 12;
    }

    .sfb-btn-submit,
    .sfb-btn-whatsapp {
        width: 100%;
        justify-content: center;
    }
}
