/* ============================================
   CONSULTATION FORM - FRONTEND STYLES
   Engagement Hub Design System
   Poll-style layout with numbered questions
   ============================================ */

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

/* Container */
.fm-consultation-form {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    max-width: 1280px;
    margin: 32px auto;
    background: #f8fafc;
    padding: 0;
    box-sizing: border-box;
}

.fm-consultation-form *,
.fm-consultation-form *::before,
.fm-consultation-form *::after {
    box-sizing: border-box;
}

/* Title */
.fm-form-title {
    margin: 0 0 20px !important;
    padding: 0 !important;
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    line-height: 1.3 !important;
    border: none !important;
    background: none !important;
}

.fm-form-description {
    margin: 0 0 24px !important;
    padding: 0 !important;
    color: #64748b !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
}

/* Main Form Container */
.fm-form {
    background: #ffffff !important;
    border: 2px solid #7c3aed !important;
    border-radius: 16px !important;
    overflow: hidden !important;
}

/* Messages */
.fm-form-messages {
    padding: 20px 32px 0;
}

.fm-form-messages:empty {
    display: none;
    padding: 0;
}

.fm-message {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
}

.fm-message-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.fm-message-success {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

/* Form Fields - No gap, use separators */
.fm-form-fields {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
}

/* Each Field as a Section */
.fm-field {
    width: 100% !important;
    padding: 28px 32px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
    position: relative !important;
    counter-increment: field-counter !important;
}

.fm-field:last-child {
    border-bottom: none !important;
}

/* Alternating background for visual separation */
.fm-field:nth-child(even) {
    background: #f8fafc !important;
}

.fm-field-full,
.fm-field-half {
    width: 100% !important;
}

/* Field Labels with Number Badge */
.fm-field-label {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
}

.fm-field-label::before {
    content: counter(field-counter) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 26px !important;
    height: 26px !important;
    background: #7c3aed !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
}

.fm-required {
    color: #ef4444 !important;
    font-weight: 600 !important;
}

/* Reset counter on form fields container */
.fm-form-fields {
    counter-reset: field-counter !important;
}

/* Inputs */
.fm-input,
.fm-select,
.fm-textarea {
    width: 100% !important;
    padding: 14px 18px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-weight: 400 !important;
    transition: all 0.2s ease !important;
    background: #ffffff !important;
    color: #1e293b !important;
    line-height: 1.5 !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    margin-left: 38px !important;
    width: calc(100% - 38px) !important;
}

.fm-input:focus,
.fm-select:focus,
.fm-textarea:focus {
    outline: none !important;
    border-color: #7c3aed !important;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12) !important;
}

.fm-input::placeholder,
.fm-textarea::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
}

.fm-textarea {
    resize: vertical !important;
    min-height: 120px !important;
}

.fm-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 14px center !important;
    background-repeat: no-repeat !important;
    background-size: 18px !important;
    padding-right: 48px !important;
    cursor: pointer !important;
}

/* Radio & Checkbox Groups - Simple list style */
.fm-radio-group,
.fm-checkbox-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    margin-left: 38px !important;
}

.fm-radio-label,
.fm-checkbox-label {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    cursor: pointer !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    color: #334155 !important;
    padding: 12px 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    transition: color 0.15s ease !important;
    margin: 0 !important;
}

.fm-radio-label:hover,
.fm-checkbox-label:hover {
    color: #7c3aed !important;
    background: transparent !important;
}

.fm-radio-label input[type="radio"],
.fm-checkbox-label input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    accent-color: #7c3aed !important;
    margin: 0 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
}

/* Star Rating */
.fm-rating {
    display: flex !important;
    gap: 8px !important;
    padding: 8px 0 !important;
    margin-left: 38px !important;
}

.fm-star {
    font-size: 32px !important;
    cursor: pointer !important;
    color: #cbd5e1 !important;
    transition: all 0.15s ease !important;
    user-select: none !important;
    line-height: 1 !important;
}

.fm-star:hover,
.fm-star.hover {
    color: #fbbf24 !important;
    transform: scale(1.1) !important;
}

.fm-star.active {
    color: #fbbf24 !important;
}

/* Form Actions */
.fm-form-actions {
    margin: 0 !important;
    padding: 24px 32px !important;
    border-top: none !important;
    background: #f8fafc !important;
}

.fm-submit-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 16px 40px !important;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3) !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    line-height: 1.4 !important;
}

.fm-submit-btn:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4) !important;
    color: #ffffff !important;
}

.fm-submit-btn:active {
    transform: translateY(0) !important;
}

.fm-submit-btn:disabled {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

.fm-submit-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.25), 0 4px 14px rgba(124, 58, 237, 0.3) !important;
}

/* Spinner */
.fm-submit-btn .fm-spinner {
    width: 20px !important;
    height: 20px !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-top-color: #fff !important;
    border-radius: 50% !important;
    animation: fm-spin 0.6s linear infinite !important;
}

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

/* Success State */
.fm-form-success {
    text-align: center !important;
    padding: 56px 32px !important;
    background: #ffffff !important;
}

.fm-success-icon {
    width: 72px !important;
    height: 72px !important;
    margin: 0 auto 24px !important;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #fff !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 36px !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3) !important;
}

.fm-form-success h3 {
    margin: 0 0 12px !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
}

.fm-form-success p {
    margin: 0 !important;
    color: #64748b !important;
    font-size: 16px !important;
}

/* Error State */
.fm-field.has-error .fm-input,
.fm-field.has-error .fm-select,
.fm-field.has-error .fm-textarea {
    border-color: #ef4444 !important;
}

.fm-field-error {
    margin-top: 8px !important;
    margin-left: 38px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #ef4444 !important;
}

/* Form Error */
.fm-form-error {
    padding: 18px 24px !important;
    margin: 24px !important;
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    border-radius: 10px !important;
    color: #dc2626 !important;
    text-align: center !important;
    font-weight: 500 !important;
}

/* Loading State */
.fm-consultation-form.loading .fm-form {
    opacity: 0.6 !important;
    pointer-events: none !important;
}

/* Hidden fields should not show numbers */
.fm-field[data-field-type="hidden"] {
    display: none !important;
}

/* Responsive */
@media (max-width: 640px) {
    .fm-consultation-form {
        margin: 16px;
    }

    .fm-field {
        padding: 24px 20px !important;
    }

    .fm-form-actions {
        padding: 20px !important;
    }

    .fm-input,
    .fm-select,
    .fm-textarea,
    .fm-radio-group,
    .fm-checkbox-group,
    .fm-rating {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .fm-field-label::before {
        min-width: 24px !important;
        height: 24px !important;
        font-size: 12px !important;
    }
}

/* Theme Override Reset */
.fm-consultation-form button,
.fm-consultation-form input,
.fm-consultation-form select,
.fm-consultation-form textarea {
    margin: 0;
}

.fm-consultation-form button {
    -webkit-appearance: none;
    appearance: none;
}

/* ============================================
   WIZARD MODE - HORIZONTAL STEP NAVIGATION
   ============================================ */

.fm-wizard-form .fm-form {
    overflow: hidden !important;
}

/* Progress Bar */
.fm-wizard-progress {
    padding: 20px 32px !important;
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

.fm-wizard-progress-bar {
    height: 4px !important;
    background: linear-gradient(90deg, #7c3aed 0%, #a78bfa 100%) !important;
    border-radius: 2px !important;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.fm-wizard-step-indicator {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #64748b !important;
    text-align: center !important;
}

.fm-current-step-num {
    color: #7c3aed !important;
    font-weight: 700 !important;
}

/* Viewport for horizontal slides */
.fm-wizard-viewport {
    overflow: hidden !important;
    position: relative !important;
}

.fm-wizard-track {
    display: flex !important;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    will-change: transform !important;
}

/* Individual step slide */
.fm-wizard-step {
    flex: 0 0 100% !important;
    min-width: 100% !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

.fm-wizard-step.active {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Step content */
.fm-wizard-step-content {
    padding: 32px !important;
}

/* Override field styling for wizard mode */
.fm-wizard-step .fm-field {
    padding: 0 !important;
    border-bottom: none !important;
    background: transparent !important;
    counter-increment: none !important;
}

.fm-wizard-step .fm-field-label {
    justify-content: center !important;
    text-align: center !important;
    font-size: 20px !important;
    margin-bottom: 24px !important;
}

.fm-wizard-step .fm-field-label::before {
    display: none !important;
}

.fm-wizard-step .fm-input,
.fm-wizard-step .fm-select,
.fm-wizard-step .fm-textarea {
    margin-left: 0 !important;
    width: 100% !important;
    font-size: 16px !important;
    padding: 16px 20px !important;
}

.fm-wizard-step .fm-radio-group,
.fm-wizard-step .fm-checkbox-group,
.fm-wizard-step .fm-rating {
    margin-left: 0 !important;
    justify-content: center !important;
}

.fm-wizard-step .fm-rating {
    justify-content: center !important;
}

/* Step navigation */
.fm-wizard-step-nav {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 20px 32px !important;
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
}

/* Wizard buttons */
.fm-wizard-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 14px 28px !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
}

.fm-wizard-btn svg {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
}

.fm-wizard-btn-back {
    background: #ffffff !important;
    color: #64748b !important;
    border: 2px solid #e2e8f0 !important;
}

.fm-wizard-btn-back:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

.fm-wizard-btn-next,
.fm-wizard-btn-submit {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3) !important;
}

.fm-wizard-btn-next:hover,
.fm-wizard-btn-submit:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4) !important;
}

.fm-wizard-btn-next:active,
.fm-wizard-btn-submit:active {
    transform: translateY(0) !important;
}

/* Error in wizard mode */
.fm-wizard-step .fm-field-error {
    margin-left: 0 !important;
    text-align: center !important;
}

/* Responsive wizard */
@media (max-width: 640px) {
    .fm-wizard-progress {
        padding: 16px 20px !important;
    }

    .fm-wizard-step-content {
        padding: 24px 20px !important;
    }

    .fm-wizard-step-nav {
        padding: 16px 20px !important;
    }

    .fm-wizard-btn {
        padding: 12px 20px !important;
        font-size: 14px !important;
    }

    .fm-wizard-step .fm-field-label {
        font-size: 18px !important;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .fm-wizard-track,
    .fm-wizard-step,
    .fm-wizard-progress-bar {
        transition: none !important;
    }
}
