/* Operations Intake — Shared styles for client and admin */

.intake-wizard {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Toolbar (combined progress + status + actions) */
.intake-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    background: var(--v2-bg-elevated);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-lg);
}
.intake-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.intake-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Progress (inline within toolbar) */
.intake-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}
.intake-progress-bar {
    width: 100px;
    height: 6px;
    background: var(--v2-border);
    border-radius: 3px;
    overflow: hidden;
}
.intake-progress-fill {
    height: 100%;
    background: var(--v2-accent);
    border-radius: 3px;
    transition: width 0.3s ease;
    min-width: 0;
}
.intake-progress-text {
    font-size: var(--v2-text-xs);
    color: var(--v2-fg-muted);
    white-space: nowrap;
    font-weight: 500;
}

/* Section navigation */
.intake-sections {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.intake-section-card {
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-lg);
    overflow: hidden;
    background: var(--v2-bg-elevated);
    transition: border-color 0.15s;
}
.intake-section-card.active {
    border-color: var(--v2-accent);
}
.intake-section-card.completed {
    border-color: var(--v2-success);
}

.intake-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}
.intake-section-header:hover {
    background: var(--v2-surface-hover);
}
.intake-section-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--v2-radius-md);
    background: var(--v2-surface-hover);
    color: var(--v2-fg-muted);
    flex-shrink: 0;
}
.intake-section-card.active .intake-section-icon {
    background: var(--v2-accent-subtle);
    color: var(--v2-accent);
}
.intake-section-card.completed .intake-section-icon {
    background: var(--v2-success-bg);
    color: var(--v2-success);
}
.intake-section-info {
    flex: 1;
    min-width: 0;
}
.intake-section-title {
    font-size: var(--v2-text-sm);
    font-weight: 600;
    color: var(--v2-fg);
}
.intake-section-desc {
    font-size: var(--v2-text-xs);
    color: var(--v2-fg-muted);
    margin-top: 2px;
}
.intake-section-badge {
    font-size: var(--v2-text-xs);
    font-weight: 500;
    padding: 2px 8px;
    border-radius: var(--v2-radius-full);
    white-space: nowrap;
}
.intake-section-badge.required {
    background: var(--v2-accent-subtle);
    color: var(--v2-accent);
}
.intake-section-badge.optional {
    background: var(--v2-surface-hover);
    color: var(--v2-fg-muted);
}
.intake-section-badge.done {
    background: var(--v2-success-bg);
    color: var(--v2-success);
}
.intake-section-chevron {
    color: var(--v2-fg-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}
.intake-section-card.active .intake-section-chevron {
    transform: rotate(90deg);
}

/* Section body (questions) */
.intake-section-body {
    display: none;
    padding: 0 20px 20px;
}
.intake-section-card.active .intake-section-body {
    display: block;
}

/* Question items */
.intake-question {
    padding: 16px 0;
}
.intake-question + .intake-question {
    border-top: 1px solid var(--v2-border);
}
.intake-question-label {
    font-size: var(--v2-text-sm);
    font-weight: 500;
    color: var(--v2-fg);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.intake-question-required {
    color: var(--v2-error);
    font-size: var(--v2-text-xs);
}

/* Multi-select freeform */
.intake-multi-select {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.intake-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: var(--v2-radius-full);
    border: 1px solid var(--v2-border);
    background: var(--v2-bg-elevated);
    color: var(--v2-fg);
    font-size: var(--v2-text-xs);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}
.intake-chip:hover {
    border-color: var(--v2-accent);
    background: var(--v2-accent-subtle);
}
.intake-chip.selected {
    border-color: var(--v2-accent);
    background: var(--v2-accent-subtle);
    color: var(--v2-accent);
}

/* Boolean toggle */
.intake-toggle {
    display: flex;
    gap: 8px;
}
.intake-toggle-btn {
    padding: 8px 20px;
    border-radius: var(--v2-radius-md);
    border: 1px solid var(--v2-border);
    background: var(--v2-bg-elevated);
    color: var(--v2-fg);
    font-size: var(--v2-text-sm);
    cursor: pointer;
    transition: all 0.15s;
}
.intake-toggle-btn:hover {
    border-color: var(--v2-accent);
}
.intake-toggle-btn.selected {
    border-color: var(--v2-accent);
    background: var(--v2-accent-subtle);
    color: var(--v2-accent);
    font-weight: 500;
}


/* Status badge */
.intake-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--v2-radius-full);
    font-size: var(--v2-text-xs);
    font-weight: 500;
}
/* D04: ready_for_review uses an amber/yellow tint distinct from --v2-warning's
   orange (#f59e0b). Status families intentionally use a darker yellow to read
   distinctly from the warning ribbon family. Kept inline. */
.intake-status.in_progress { background: var(--v2-accent-subtle); color: var(--v2-accent); }
.intake-status.ready_for_review { background: rgba(234, 179, 8, 0.1); color: rgb(234, 179, 8); }
.intake-status.approved { background: var(--v2-success-bg); color: var(--v2-success); }
.intake-status.applied { background: var(--v2-success-bg); color: var(--v2-success); }

/* Apply preview */
.intake-preview {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.intake-preview-group {
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-md);
    overflow: hidden;
}
.intake-preview-group-title {
    padding: 10px 16px;
    background: var(--v2-surface-hover);
    font-size: var(--v2-text-xs);
    font-weight: 600;
    color: var(--v2-fg-muted);
    text-transform: uppercase;
    letter-spacing: var(--v2-tracking-wide);
}
.intake-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: var(--v2-text-sm);
}
.intake-preview-item + .intake-preview-item {
    border-top: 1px solid var(--v2-border);
}
.intake-preview-action {
    font-size: var(--v2-text-xs);
    font-weight: 500;
    padding: 2px 8px;
    border-radius: var(--v2-radius-sm);
}
.intake-preview-action.create { background: var(--v2-success-bg); color: var(--v2-success); }
.intake-preview-action.update { background: var(--v2-accent-subtle); color: var(--v2-accent); }
.intake-preview-action.unchanged { background: var(--v2-surface-hover); color: var(--v2-fg-muted); }

/* === Mobile === */
@media (max-width: 768px) {
    .intake-wizard {
        gap: 14px;
    }

    /* Toolbar wraps so action buttons drop to their own row instead of overflowing */
    .intake-toolbar {
        flex-wrap: wrap;
        gap: 10px 12px;
        padding: 12px 14px;
    }
    .intake-toolbar-left {
        flex: 1 1 auto;
        min-width: 0;
        flex-wrap: wrap;
        row-gap: 8px;
    }
    .intake-toolbar-right {
        flex: 1 1 100%;
        justify-content: flex-end;
    }
    .intake-toolbar-right .v2-btn {
        flex: 1 1 auto;
    }
    .intake-progress-bar {
        width: 80px;
    }

    /* Section header: tighter horizontal padding, allow text columns to truncate
       so the badge + chevron stay aligned on the right */
    .intake-section-header {
        padding: 14px 14px;
        gap: 10px;
    }
    .intake-section-icon {
        width: 28px;
        height: 28px;
    }
    .intake-section-info {
        min-width: 0;
    }
    .intake-section-title,
    .intake-section-desc {
        overflow-wrap: anywhere;
    }

    .intake-section-body {
        padding: 0 14px 16px;
    }

    .intake-question {
        padding: 14px 0;
    }

    /* Boolean toggle wraps if Yes/No labels get long via translation */
    .intake-toggle {
        flex-wrap: wrap;
    }
}
