/**
 * Forms Page Styles
 * Version: 20251227a - Table-based UX for form management
 */

/* ==================
   Page Container
   ================== */

.forms-page {
    padding: 32px 40px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* ==================
   Page Header
   ================== */

.forms-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.forms-header-text {
    flex: 1;
}

.forms-title {
    font-size: 28px;
    font-weight: 700;
    color: #101828;
    margin: 0 0 4px 0;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.forms-subtitle {
    font-size: 15px;
    font-weight: 400;
    color: #6A7282;
    margin: 0;
    line-height: 1.5;
}

.forms-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #FFFFFF;
    background: #101828;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.forms-add-btn:hover {
    background: #1f2937;
}

.forms-add-btn svg {
    width: 16px;
    height: 16px;
}

/* ==================
   Summary Cards
   ================== */

.forms-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1100px) {
    .forms-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .forms-summary-grid {
        grid-template-columns: 1fr;
    }
}

.forms-summary-card {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid #E5E7EB;
}

.forms-summary-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.forms-summary-icon svg {
    width: 20px;
    height: 20px;
}

.forms-summary-icon--blue {
    background: #DBEAFE;
}

.forms-summary-icon--blue svg {
    stroke: #2563EB;
}

.forms-summary-icon--green {
    background: #DCFCE7;
}

.forms-summary-icon--green svg {
    stroke: #16A34A;
}

.forms-summary-icon--purple {
    background: #F3E8FF;
}

.forms-summary-icon--purple svg {
    stroke: #9333EA;
}

.forms-summary-icon--yellow {
    background: #FEF3C7;
}

.forms-summary-icon--yellow svg {
    stroke: #D97706;
}

.forms-summary-value {
    font-size: 28px;
    font-weight: 700;
    color: #101828;
    margin: 0 0 2px 0;
    line-height: 1.2;
}

.forms-summary-label {
    font-size: 14px;
    font-weight: 500;
    color: #6A7282;
    margin: 0;
}

/* ==================
   Type Filters
   ================== */

.forms-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.forms-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #364153;
    background: #FFFFFF;
    border: 1px solid #D1D5DC;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.forms-filter-btn:hover {
    background: #F9FAFB;
    border-color: #9CA3AF;
}

.forms-filter-btn.active {
    background: #101828;
    color: #FFFFFF;
    border-color: #101828;
}

.forms-filter-label {
    font-weight: 500;
}

.forms-filter-count {
    font-size: 13px;
    font-weight: 500;
    color: #6A7282;
    background: #F3F4F6;
    padding: 2px 8px;
    border-radius: 4px;
    min-width: 24px;
    text-align: center;
}

.forms-filter-btn.active .forms-filter-count {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.2);
}

/* ==================
   Search Section
   ================== */

.forms-search-section {
    margin-bottom: 16px;
}

.forms-search-bar {
    position: relative;
    max-width: 400px;
}

.forms-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    pointer-events: none;
}

.forms-search-input {
    width: 100%;
    padding: 10px 14px 10px 42px;
    font-size: 14px;
    font-weight: 400;
    color: #101828;
    background: #FFFFFF;
    border: 1px solid #D1D5DC;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.forms-search-input:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.forms-search-input::placeholder {
    color: #9CA3AF;
}

/* ==================
   Table Styles
   ================== */

.forms-table-container {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.forms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.forms-table thead {
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
}

.forms-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #6A7282;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.forms-table tbody tr {
    border-bottom: 1px solid #F3F4F6;
    transition: background 0.15s ease;
}

.forms-table tbody tr:last-child {
    border-bottom: none;
}

.forms-table tbody tr:hover {
    background: #F9FAFB;
}

.forms-table td {
    padding: 14px 16px;
    color: #101828;
    vertical-align: middle;
}

/* Form Name Cell */
.forms-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.forms-name-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.forms-name-icon svg {
    width: 18px;
    height: 18px;
}

.forms-name-icon--lead_gen {
    background: #DBEAFE;
}

.forms-name-icon--lead_gen svg {
    stroke: #2563EB;
}

.forms-name-icon--survey {
    background: #F3E8FF;
}

.forms-name-icon--survey svg {
    stroke: #9333EA;
}

.forms-name-icon--intake {
    background: #DCFCE7;
}

.forms-name-icon--intake svg {
    stroke: #16A34A;
}

.forms-name-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.forms-name-text {
    font-size: 14px;
    font-weight: 600;
    color: #101828;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.forms-name-questions {
    font-size: 13px;
    color: #6A7282;
}

/* Type Badge */
.forms-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 9999px;
}

.forms-type-badge--lead_gen {
    background: #DBEAFE;
    color: #1E40AF;
}

.forms-type-badge--survey {
    background: #F3E8FF;
    color: #6B21A8;
}

.forms-type-badge--intake {
    background: #DCFCE7;
    color: #166534;
}

/* Responses Count */
.forms-responses {
    font-weight: 600;
    color: #101828;
}

/* Completion Rate */
.forms-completion {
    display: flex;
    align-items: center;
    gap: 8px;
}

.forms-completion-bar {
    width: 80px;
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
}

.forms-completion-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.forms-completion-fill--low {
    background: #F87171;
}

.forms-completion-fill--medium {
    background: #FBBF24;
}

.forms-completion-fill--high {
    background: #34D399;
}

.forms-completion-text {
    font-size: 13px;
    font-weight: 500;
    color: #6A7282;
    min-width: 36px;
}

/* Date Cell */
.forms-date {
    font-size: 13px;
    color: #6A7282;
    white-space: nowrap;
}

/* Status Badge */
.forms-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 9999px;
}

.forms-status-badge--active {
    background: #DCFCE7;
    color: #166534;
}

.forms-status-badge--inactive {
    background: #F3F4F6;
    color: #6B7280;
}

.forms-status-badge--draft {
    background: #FEF3C7;
    color: #92400E;
}

/* Action Buttons */
.forms-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.forms-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #6A7282;
    cursor: pointer;
    transition: all 0.15s ease;
}

.forms-action-btn:hover {
    background: #F3F4F6;
    color: #101828;
}

.forms-action-btn svg {
    width: 16px;
    height: 16px;
}

.forms-action-btn--danger:hover {
    background: #FEE2E2;
    color: #DC2626;
}

/* ==================
   Loading State
   ================== */

.forms-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    color: #6A7282;
}

.forms-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #E5E7EB;
    border-top-color: #2563EB;
    border-radius: 50%;
    animation: forms-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

.forms-loading p {
    font-size: 14px;
    margin: 0;
    color: #6A7282;
}

/* ==================
   Empty State
   ================== */

.forms-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
}

.forms-empty svg {
    color: #D1D5DC;
    margin-bottom: 16px;
}

.forms-empty h3 {
    font-size: 16px;
    font-weight: 600;
    color: #101828;
    margin: 0 0 8px 0;
}

.forms-empty p {
    font-size: 14px;
    color: #6A7282;
    margin: 0 0 20px 0;
    max-width: 320px;
    line-height: 1.5;
}

.forms-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #FFFFFF;
    background: #9810FA;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.forms-empty-btn:hover {
    background: #7c0ed1;
}

/* ==================
   Pagination
   ================== */

.forms-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.forms-pagination-info {
    font-size: 14px;
    color: #6A7282;
}

.forms-pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.forms-pagination-btn {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #364153;
    background: #FFFFFF;
    border: 1px solid #D1D5DC;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.forms-pagination-btn:hover:not(:disabled) {
    background: #F9FAFB;
    border-color: #9CA3AF;
}

.forms-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.forms-pagination-pages {
    display: flex;
    gap: 4px;
}

.forms-pagination-page {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: #364153;
    background: #FFFFFF;
    border: 1px solid #D1D5DC;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.forms-pagination-page:hover:not(.active) {
    background: #F9FAFB;
    border-color: #9CA3AF;
}

.forms-pagination-page.active {
    background: #101828;
    color: #FFFFFF;
    border-color: #101828;
}

/* ==================
   Share Modal
   ================== */

.forms-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.forms-modal.active {
    display: flex;
}

.forms-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.forms-modal-content {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.forms-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
}

.forms-modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #101828;
    margin: 0;
}

.forms-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #6A7282;
    cursor: pointer;
    transition: all 0.15s ease;
}

.forms-modal-close:hover {
    background: #F3F4F6;
    color: #101828;
}

.forms-modal-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.forms-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 20px 24px;
    border-top: 1px solid #E5E7EB;
}

.forms-modal-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.forms-modal-btn--primary {
    background: #101828;
    color: #FFFFFF;
}

.forms-modal-btn--primary:hover {
    background: #1f2937;
}

.forms-modal-btn--secondary {
    background: #F3F4F6;
    color: #364153;
}

.forms-modal-btn--secondary:hover {
    background: #E5E7EB;
}

/* Share Sections */
.forms-share-section {
    margin-bottom: 20px;
}

.forms-share-section:last-child {
    margin-bottom: 0;
}

.forms-share-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #364153;
    margin-bottom: 8px;
}

.forms-share-input-group {
    display: flex;
    gap: 8px;
}

.forms-share-input {
    flex: 1;
    padding: 10px 14px;
    font-size: 13px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    color: #101828;
    background: #F9FAFB;
    border: 1px solid #D1D5DC;
    border-radius: 8px;
    outline: none;
}

.forms-share-textarea {
    flex: 1;
    padding: 10px 14px;
    font-size: 12px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    color: #101828;
    background: #F9FAFB;
    border: 1px solid #D1D5DC;
    border-radius: 8px;
    outline: none;
    resize: none;
    line-height: 1.5;
}

.forms-share-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #364153;
    background: #FFFFFF;
    border: 1px solid #D1D5DC;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.forms-share-copy-btn:hover {
    background: #F9FAFB;
    border-color: #9CA3AF;
}

.forms-share-copy-btn svg {
    width: 14px;
    height: 14px;
}

/* ==================
   Status Select (inline)
   ================== */

.forms-status-select {
    padding: 4px 28px 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    appearance: none;
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    transition: all 0.15s ease;
}

.forms-status-select:hover {
    opacity: 0.9;
}

.forms-status-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.forms-status-select--active {
    background-color: #DCFCE7;
    color: #166534;
}

.forms-status-select--inactive {
    background-color: #F3F4F6;
    color: #6B7280;
}

.forms-status-select--draft {
    background-color: #FEF3C7;
    color: #92400E;
}

/* ==================
   Form Input Styles
   ================== */

.forms-form-group {
    margin-bottom: 20px;
}

.forms-form-group:last-child {
    margin-bottom: 0;
}

.forms-form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #364153;
    margin-bottom: 8px;
}

.forms-form-input,
.forms-form-textarea,
.forms-form-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 400;
    color: #101828;
    background: #FFFFFF;
    border: 1px solid #D1D5DC;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.forms-form-input:focus,
.forms-form-textarea:focus,
.forms-form-select:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.forms-form-input::placeholder,
.forms-form-textarea::placeholder {
    color: #9CA3AF;
}

.forms-form-textarea {
    resize: vertical;
    min-height: 80px;
}

.forms-form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.forms-form-hint {
    font-size: 13px;
    color: #6A7282;
    margin: 6px 0 0 0;
}

/* ==================
   Modal Error State
   ================== */

.forms-modal-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}

/* ==================
   Toast Notification
   ================== */

.forms-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    background: #101828;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.forms-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.forms-toast.success {
    background: #166534;
}

.forms-toast.error {
    background: #B91C1C;
}

/* ==================
   Mobile Responsive
   ================== */

@media (max-width: 1024px) {
    .forms-table-container {
        overflow-x: auto;
    }

    .forms-table {
        min-width: 800px;
    }
}

@media (max-width: 768px) {
    .forms-page {
        padding: 20px 16px;
    }

    .forms-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .forms-add-btn {
        width: 100%;
        justify-content: center;
    }

    .forms-title {
        font-size: 24px;
    }

    .forms-pagination {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .forms-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
}

/* ==========================================
   FORM WIZARD STYLES
   ========================================== */

.forms-wizard-modal .forms-modal-content {
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.forms-wizard-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Wizard Step Indicator */
.forms-wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
    gap: 8px;
}

.forms-wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.forms-wizard-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #F3F4F6;
    color: #6B7280;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.forms-wizard-step.active .forms-wizard-step-number {
    background: #2D9C6E;
    color: white;
}

.forms-wizard-step.completed .forms-wizard-step-number {
    background: #D1FAE5;
    color: #059669;
}

.forms-wizard-step.completed .forms-wizard-step-number::after {
    content: '✓';
}

.forms-wizard-step-label {
    font-size: 11px;
    color: #9CA3AF;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forms-wizard-step.active .forms-wizard-step-label {
    color: #2D9C6E;
}

.forms-wizard-step-line {
    width: 32px;
    height: 2px;
    background: #E5E7EB;
    margin: 0 4px;
    margin-bottom: 20px;
}

/* Wizard Content */
.forms-wizard-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.forms-wizard-panel {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.forms-wizard-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #F0FDF4;
    border-radius: 10px;
    margin-bottom: 20px;
}

.forms-wizard-info svg {
    color: #2D9C6E;
    flex-shrink: 0;
    margin-top: 1px;
}

.forms-wizard-info span {
    font-size: 14px;
    color: #166534;
    line-height: 1.5;
}

/* Example Chips */
.forms-wizard-examples {
    margin-top: 16px;
}

.forms-wizard-examples-label {
    font-size: 13px;
    color: #6B7280;
    margin-bottom: 10px;
}

.forms-example-chip {
    display: inline-flex;
    padding: 8px 14px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 20px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-right: 8px;
    margin-bottom: 8px;
}

.forms-example-chip:hover {
    background: #F3F4F6;
    border-color: #D1D5DB;
}

.forms-example-chip:active {
    background: #E5E7EB;
}

/* Generated Fields List */
.forms-generated-fields {
    min-height: 200px;
}

.forms-fields-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 16px;
    color: #6B7280;
}

.forms-fields-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #E5E7EB;
    border-top-color: #2D9C6E;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.forms-fields-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.forms-field-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    transition: all 0.15s ease;
}

.forms-field-item:hover {
    border-color: #D1D5DB;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.forms-field-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #2D9C6E;
}

.forms-field-info {
    flex: 1;
}

.forms-field-label {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
}

.forms-field-type {
    font-size: 12px;
    color: #6B7280;
    margin-top: 2px;
}

.forms-field-required {
    font-size: 11px;
    padding: 3px 8px;
    background: #FEF3C7;
    color: #92400E;
    border-radius: 4px;
    font-weight: 500;
}

.forms-regenerate-row {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

/* Customize Fields (Step 3) */
.forms-customize-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 200px;
}

.forms-customize-field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    cursor: grab;
    transition: all 0.15s ease;
}

.forms-customize-field:hover {
    border-color: #2D9C6E;
    background: #F9FAFB;
}

.forms-customize-field.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.forms-field-drag-handle {
    color: #9CA3AF;
    cursor: grab;
}

.forms-field-drag-handle svg {
    width: 16px;
    height: 16px;
}

.forms-field-edit-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.forms-field-edit-label {
    font-size: 14px;
    color: #111827;
    font-weight: 500;
}

.forms-field-edit-type {
    font-size: 12px;
    color: #6B7280;
    background: #F3F4F6;
    padding: 2px 8px;
    border-radius: 4px;
}

.forms-field-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.forms-field-required-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #6B7280;
}

.forms-field-required-toggle input {
    accent-color: #2D9C6E;
}

.forms-field-edit-btn,
.forms-field-delete-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.15s ease;
}

.forms-field-edit-btn:hover {
    background: #F3F4F6;
    color: #2D9C6E;
}

.forms-field-delete-btn:hover {
    background: #FEE2E2;
    color: #DC2626;
}

.forms-add-field-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    background: transparent;
    border: 2px dashed #E5E7EB;
    border-radius: 8px;
    color: #6B7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.forms-add-field-btn:hover {
    border-color: #2D9C6E;
    color: #2D9C6E;
    background: #F0FDF4;
}

/* Settings Section (Step 4) */
.forms-settings-section {
    margin: 20px 0;
}

.forms-settings-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

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

.forms-checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: #2D9C6E;
}

/* Preview (Step 5) */
.forms-preview-container {
    background: #F9FAFB;
    border-radius: 12px;
    overflow: hidden;
}

.forms-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #F3F4F6;
    border-bottom: 1px solid #E5E7EB;
}

.forms-preview-label {
    font-size: 13px;
    font-weight: 500;
    color: #6B7280;
}

.forms-preview-device-toggle {
    display: flex;
    gap: 4px;
}

.forms-device-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #9CA3AF;
    cursor: pointer;
    transition: all 0.15s ease;
}

.forms-device-btn:hover {
    background: #E5E7EB;
    color: #374151;
}

.forms-device-btn.active {
    background: white;
    color: #2D9C6E;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.forms-preview-frame {
    padding: 24px;
    min-height: 300px;
    display: flex;
    justify-content: center;
}

.forms-preview-frame.mobile {
    max-width: 375px;
    margin: 0 auto;
}

/* Form Preview Content */
.forms-preview-form {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.forms-preview-form-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 20px;
}

.forms-preview-field {
    margin-bottom: 16px;
}

.forms-preview-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.forms-preview-field input,
.forms-preview-field select,
.forms-preview-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
}

.forms-preview-submit {
    width: 100%;
    padding: 12px;
    background: #2D9C6E;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
    cursor: pointer;
}

.forms-preview-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 20px;
}

.forms-preview-fields {
    margin-bottom: 16px;
}

.forms-preview-field-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.forms-preview-required {
    color: #EF4444;
    margin-left: 2px;
}

.forms-preview-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    background: #F9FAFB;
}

.forms-preview-textarea {
    min-height: 80px;
    resize: vertical;
}

.forms-preview-select {
    cursor: pointer;
}

.forms-preview-rating {
    display: flex;
    gap: 8px;
}

.forms-preview-star {
    font-size: 24px;
    color: #D1D5DB;
    cursor: pointer;
}

.forms-preview-star:hover,
.forms-preview-star.active {
    color: #F59E0B;
}

.forms-preview-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

.forms-preview-checkbox input {
    width: 18px;
    height: 18px;
}

/* Activate (Step 6) */
.forms-activate-summary {
    text-align: center;
    padding: 24px 0;
}

.forms-activate-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: #D1FAE5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.forms-activate-icon svg {
    color: #059669;
}

.forms-activate-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.forms-activate-description {
    font-size: 14px;
    color: #6B7280;
}

.forms-activate-options {
    margin-top: 24px;
}

.forms-activate-option {
    margin-bottom: 20px;
}

.forms-activate-option h4 {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.forms-share-link-row {
    display: flex;
    gap: 8px;
}

.forms-share-link-row input {
    flex: 1;
    background: #F9FAFB;
}

.forms-copy-btn {
    padding: 10px 16px;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
}

.forms-copy-btn:hover {
    background: #E5E7EB;
}

.forms-embed-code {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #1F2937;
    border-radius: 8px;
}

.forms-embed-code code {
    flex: 1;
    font-size: 12px;
    color: #9CA3AF;
    font-family: 'Monaco', 'Menlo', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.forms-embed-code .forms-copy-btn {
    background: #374151;
    border-color: #4B5563;
    color: white;
}

.forms-embed-code .forms-copy-btn:hover {
    background: #4B5563;
}

.forms-ai-collection-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #EFF6FF;
    border-radius: 10px;
}

.forms-ai-collection-note svg {
    color: #3B82F6;
    flex-shrink: 0;
    margin-top: 1px;
}

.forms-ai-collection-note span {
    font-size: 13px;
    color: #1E40AF;
    line-height: 1.5;
}

/* Wizard Footer */
.forms-wizard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid #E5E7EB;
    background: #FAFAFA;
}

.forms-wizard-footer-left {
    display: flex;
    align-items: center;
}

.forms-wizard-step-counter {
    font-size: 13px;
    color: #6B7280;
}

.forms-wizard-footer-right {
    display: flex;
    gap: 12px;
}

.forms-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s ease;
}

.forms-btn-secondary:hover {
    background: #E5E7EB;
}

.forms-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: #2D9C6E;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.15s ease;
}

.forms-btn-primary:hover {
    background: #248c5f;
}

.forms-btn-activate {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: #2D9C6E;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.15s ease;
}

.forms-btn-activate:hover {
    background: #248c5f;
}

/* Wizard Responsive */
@media (max-width: 640px) {
    .forms-wizard-steps {
        padding: 16px 12px;
        gap: 4px;
    }

    .forms-wizard-step-label {
        display: none;
    }

    .forms-wizard-step-line {
        width: 20px;
        margin-bottom: 0;
    }

    .forms-wizard-content {
        padding: 16px;
    }

    .forms-wizard-footer {
        flex-direction: column;
        gap: 12px;
    }

    .forms-wizard-footer-right {
        width: 100%;
    }

    .forms-wizard-footer-right button {
        flex: 1;
    }
}

/* ==========================================
   RESPONSES MODAL STYLES
   ========================================== */

.forms-responses-modal .forms-modal-content {
    max-width: 700px;
    max-height: 85vh;
}

.forms-responses-container {
    display: flex;
    flex-direction: column;
}

.forms-responses-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.forms-responses-header-info h2 {
    font-size: 18px;
    font-weight: 600;
    color: #101828;
    margin: 0;
}

.forms-responses-count {
    font-size: 13px;
    font-weight: 500;
    color: #6B7280;
    background: #F3F4F6;
    padding: 4px 10px;
    border-radius: 20px;
}

.forms-responses-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    min-height: 300px;
    max-height: 55vh;
}

.forms-responses-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    gap: 16px;
    color: #6B7280;
}

.forms-responses-loading p {
    margin: 0;
    font-size: 14px;
}

.forms-responses-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
    color: #9CA3AF;
}

.forms-responses-empty svg {
    margin-bottom: 16px;
    color: #D1D5DC;
}

.forms-responses-empty h3 {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

.forms-responses-empty p {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
    max-width: 280px;
}

.forms-responses-list {
    padding: 8px 0;
}

/* Individual Response Item */
.forms-response-item {
    border-bottom: 1px solid #F3F4F6;
}

.forms-response-item:last-child {
    border-bottom: none;
}

.forms-response-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.forms-response-header:hover {
    background: #F9FAFB;
}

.forms-response-item.expanded .forms-response-header {
    background: #F9FAFB;
}

.forms-response-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.forms-response-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.forms-response-info {
    flex: 1;
    min-width: 0;
}

.forms-response-name {
    font-size: 14px;
    font-weight: 600;
    color: #101828;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.forms-response-meta {
    display: flex;
    gap: 12px;
    margin-top: 2px;
}

.forms-response-meta span {
    font-size: 13px;
    color: #6B7280;
}

.forms-response-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.forms-response-status {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.forms-response-status--complete {
    background: #DCFCE7;
    color: #166534;
}

.forms-response-status--partial {
    background: #FEF3C7;
    color: #92400E;
}

.forms-response-time {
    font-size: 13px;
    color: #9CA3AF;
    white-space: nowrap;
}

.forms-response-chevron {
    color: #9CA3AF;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

/* Response Details (Expandable) */
.forms-response-details {
    padding: 0 24px 20px 76px;
    background: #FAFAFA;
    border-top: 1px solid #F3F4F6;
}

.forms-response-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding-top: 16px;
}

.forms-response-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.forms-response-field-label {
    font-size: 12px;
    font-weight: 500;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.forms-response-field-value {
    font-size: 14px;
    color: #101828;
    word-break: break-word;
}

.forms-response-no-fields {
    font-size: 14px;
    color: #9CA3AF;
    font-style: italic;
    margin: 0;
    padding: 8px 0;
}

.forms-response-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #E5E7EB;
}

.forms-response-source {
    font-size: 12px;
    color: #9CA3AF;
}

.forms-response-lead {
    font-size: 12px;
    font-weight: 500;
    color: #2563EB;
    background: #DBEAFE;
    padding: 3px 8px;
    border-radius: 4px;
}

/* Responses Footer & Pagination */
.forms-responses-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid #E5E7EB;
    background: #FAFAFA;
}

.forms-responses-pagination {
    display: flex;
    align-items: center;
    gap: 16px;
}

.forms-responses-showing {
    font-size: 13px;
    color: #6B7280;
}

.forms-responses-pagination-btns {
    display: flex;
    gap: 8px;
}

.forms-responses-pagination-btns button {
    padding: 8px 14px;
    font-size: 13px;
}

.forms-responses-pagination-btns button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* View button styling */
.forms-action-btn--view:hover {
    background: #DBEAFE;
    color: #2563EB;
}

/* Responses Modal Responsive */
@media (max-width: 640px) {
    .forms-responses-modal .forms-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .forms-responses-header-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .forms-response-header {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .forms-response-right {
        width: 100%;
        justify-content: flex-end;
        margin-top: 4px;
    }

    .forms-response-details {
        padding: 0 16px 16px 16px;
    }

    .forms-response-fields {
        grid-template-columns: 1fr;
    }

    .forms-responses-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .forms-responses-pagination {
        flex-direction: column;
        gap: 8px;
    }
}
